Small code modifications to Ir-Classes.

Adds some constructors and moves the code to the header file. Uses some of the new constructors.

A big problem with the source are the different strategies used for otherwise similar classes.
E.g. a IrField registers itself with the VarDeclaration. Same is required for IrParameter, but
in this case it is done by the caller.
This commit is contained in:
kai
2013-11-05 10:31:14 +01:00
parent 8d7f0bf0eb
commit 6fe28e1660
5 changed files with 46 additions and 88 deletions

View File

@@ -26,27 +26,21 @@
//////////////////////////////////////////////////////////////////////////////
IrAggr::IrAggr(AggregateDeclaration* aggr)
: init_type(LLStructType::create(gIR->context(), std::string(aggr->toPrettyChars()) + "_init"))
{
aggrdecl = aggr;
type = aggr->type;
packed = (type->ty == Tstruct)
? type->alignsize() == 1
: false;
: aggrdecl(aggr),
type(aggr->type),
packed((type->ty == Tstruct) ? type->alignsize() == 1 : false),
// above still need to be looked at
init = NULL;
constInit = NULL;
vtbl = NULL;
constVtbl = NULL;
classInfo = NULL;
constClassInfo = NULL;
classInterfacesArray = NULL;
init(0),
constInit(0),
init_type(LLStructType::create(gIR->context(), std::string(aggr->toPrettyChars()) + "_init")),
vtbl(0),
constVtbl(0),
classInfo(0),
constClassInfo(0),
interfaceVtblMap(),
classInterfacesArray(0),
interfacesWithVtbls()
{
}
//////////////////////////////////////////////////////////////////////////////