mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-04-29 06:30:39 +03:00
Remove VarDeclaration::aggrIndex
This commit is contained in:
parent
a0b9f95869
commit
caa2f15c8a
8 changed files with 22 additions and 25 deletions
|
@ -946,8 +946,6 @@ VarDeclaration::VarDeclaration(Loc loc, Type *type, Identifier *id, Initializer
|
|||
edtor = NULL;
|
||||
range = NULL;
|
||||
#if IN_LLVM
|
||||
aggrIndex = 0;
|
||||
|
||||
nakedUse = false;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -348,10 +348,6 @@ public:
|
|||
void accept(Visitor *v) { v->visit(this); }
|
||||
|
||||
#if IN_LLVM
|
||||
/// Index into parent aggregate.
|
||||
/// Set during type generation.
|
||||
unsigned aggrIndex;
|
||||
|
||||
/// This var is used by a naked function.
|
||||
bool nakedUse;
|
||||
|
||||
|
|
|
@ -60,11 +60,11 @@ void DtoResolveClass(ClassDeclaration* cd)
|
|||
I != E; ++I)
|
||||
{
|
||||
VarDeclaration* vd = *I;
|
||||
|
||||
if (!isIrFieldCreated(vd))
|
||||
getIrField(vd, true);
|
||||
else
|
||||
IF_LOG Logger::println("class field already exists!!!");
|
||||
IF_LOG {
|
||||
if (isIrFieldCreated(vd))
|
||||
Logger::println("class field already exists");
|
||||
}
|
||||
getIrField(vd, true);
|
||||
}
|
||||
|
||||
// emit the interfaceInfosZ symbol if necessary
|
||||
|
|
|
@ -61,7 +61,10 @@ void DtoResolveStruct(StructDeclaration* sd, Loc& callerLoc)
|
|||
I != E; ++I)
|
||||
{
|
||||
VarDeclaration *vd = *I;
|
||||
assert(!isIrFieldCreated(vd));
|
||||
IF_LOG {
|
||||
if (isIrFieldCreated(vd))
|
||||
Logger::println("struct field already exists");
|
||||
}
|
||||
getIrField(vd, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -177,8 +177,8 @@ void IrTypeClass::addBaseClassData(
|
|||
// advance offset to right past this field
|
||||
offset = vd->offset + vd->type->size();
|
||||
|
||||
// create ir field
|
||||
vd->aggrIndex = static_cast<unsigned>(field_index);
|
||||
// set the field index
|
||||
getIrField(vd, true)->setAggrIndex(static_cast<unsigned>(field_index));
|
||||
++field_index;
|
||||
}
|
||||
|
||||
|
|
|
@ -241,7 +241,8 @@ IrTypeStruct* IrTypeStruct::get(StructDeclaration* sd)
|
|||
offset = vd->offset + vd->type->size();
|
||||
|
||||
// set the field index
|
||||
vd->aggrIndex = (unsigned)field_index++;
|
||||
getIrField(vd, true)->setAggrIndex(static_cast<unsigned>(field_index));
|
||||
++field_index;
|
||||
}
|
||||
|
||||
// tail padding?
|
||||
|
|
18
ir/irvar.cpp
18
ir/irvar.cpp
|
@ -19,16 +19,14 @@
|
|||
|
||||
IrField::IrField(VarDeclaration* v) : IrVar(v)
|
||||
{
|
||||
if (v->aggrIndex)
|
||||
{
|
||||
index = v->aggrIndex;
|
||||
unionOffset = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
index = 0;
|
||||
unionOffset = v->offset;
|
||||
}
|
||||
index = 0;
|
||||
unionOffset = V->offset;
|
||||
}
|
||||
|
||||
void IrField::setAggrIndex(unsigned aggrIndex)
|
||||
{
|
||||
index = aggrIndex;
|
||||
unionOffset = 0;
|
||||
}
|
||||
|
||||
extern LLConstant* get_default_initializer(VarDeclaration* vd, Initializer* init);
|
||||
|
|
|
@ -80,6 +80,7 @@ struct IrParameter : IrLocal
|
|||
struct IrField : IrVar
|
||||
{
|
||||
IrField(VarDeclaration* v);
|
||||
void setAggrIndex(unsigned aggrIndex);
|
||||
|
||||
unsigned index;
|
||||
unsigned unionOffset;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue