mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-09-16 02:17:07 +02:00
Rewritten initialization of global variables.
This commit is contained in:
@@ -3737,6 +3737,9 @@ StructLiteralExp::StructLiteralExp(Loc loc, StructDeclaration *sd, Expressions *
|
||||
#endif
|
||||
this->soffset = 0;
|
||||
this->fillHoles = 1;
|
||||
#if IN_LLVM
|
||||
constType = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
Expression *StructLiteralExp::syntaxCopy()
|
||||
|
||||
@@ -74,6 +74,7 @@ struct DValue;
|
||||
namespace llvm {
|
||||
class Constant;
|
||||
class ConstantInt;
|
||||
class StructType;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -590,6 +591,7 @@ struct StructLiteralExp : Expression
|
||||
#elif IN_LLVM
|
||||
DValue* toElem(IRState* irs);
|
||||
llvm::Constant *toConstElem(IRState *irs);
|
||||
llvm::StructType *constType;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -114,6 +114,9 @@ StructInitializer::StructInitializer(Loc loc)
|
||||
: Initializer(loc)
|
||||
{
|
||||
ad = NULL;
|
||||
#if IN_LLVM
|
||||
ltype = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
Initializer *StructInitializer::syntaxCopy()
|
||||
|
||||
@@ -28,6 +28,12 @@ struct ArrayInitializer;
|
||||
struct ExpInitializer;
|
||||
struct HdrGenState;
|
||||
|
||||
#if IN_LLVM
|
||||
namespace llvm {
|
||||
class StructType;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
struct Initializer : Object
|
||||
{
|
||||
@@ -91,6 +97,9 @@ struct StructInitializer : Initializer
|
||||
#endif
|
||||
|
||||
StructInitializer *isStructInitializer() { return this; }
|
||||
#if IN_LLVM
|
||||
llvm::StructType *ltype;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct ArrayInitializer : Initializer
|
||||
|
||||
Reference in New Issue
Block a user