Rewritten initialization of global variables.

This commit is contained in:
Alexey Prokhin
2011-10-25 15:43:49 +04:00
parent 66a30803f3
commit 7431d58702
18 changed files with 219 additions and 29 deletions
+3
View File
@@ -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()
+2
View File
@@ -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
};
+3
View File
@@ -114,6 +114,9 @@ StructInitializer::StructInitializer(Loc loc)
: Initializer(loc)
{
ad = NULL;
#if IN_LLVM
ltype = NULL;
#endif
}
Initializer *StructInitializer::syntaxCopy()
+9
View File
@@ -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