mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-04 17:11:44 +03:00

This avoids problems where we would codegen children of an "inner" template instantiation (i.e. a member of a non-template aggregate in another module) because we have no way to know the outer (declare-only) entity exists in the respective mustDefineSymbol invocation. An example for this are the std.typecons.RefCounted internals of std.file.DirIterator, as used from std.datetime and other modules. This is not only inefficient, but also causes linking issues due to attribute inference for these functions not having run yet (and consequently the mangled name being different from the actual definition).
29 lines
836 B
C++
29 lines
836 B
C++
//===-- irtypeaggr.cpp ----------------------------------------------------===//
|
||
//
|
||
// LDC – the LLVM D compiler
|
||
//
|
||
// This file is distributed under the BSD-style LDC license. See the LICENSE
|
||
// file for details.
|
||
//
|
||
//===----------------------------------------------------------------------===//
|
||
|
||
#include "ir/irtypeaggr.h"
|
||
|
||
#if LDC_LLVM_VER >= 303
|
||
#include "llvm/IR/DerivedTypes.h"
|
||
#else
|
||
#include "llvm/DerivedTypes.h"
|
||
#endif
|
||
|
||
#include "aggregate.h"
|
||
|
||
#include "gen/irstate.h"
|
||
|
||
//////////////////////////////////////////////////////////////////////////////
|
||
//////////////////////////////////////////////////////////////////////////////
|
||
|
||
IrTypeAggr::IrTypeAggr(AggregateDeclaration * ad)
|
||
: IrType(ad->type, LLStructType::create(gIR->context(), ad->toPrettyChars())),
|
||
aggr(ad), diCompositeType(NULL)
|
||
{
|
||
}
|