diff options
author | Oliver Hunt <oliver@apple.com> | 2007-12-02 00:11:25 +0000 |
---|---|---|
committer | Oliver Hunt <oliver@apple.com> | 2007-12-02 00:11:25 +0000 |
commit | 2824723d6d181d2dfa56e62caabd68b0b18f0b9d (patch) | |
tree | 8b7969bd6e749a3ae1ee582881a1af74710cc9e0 /CodeGen/CodeGenModule.cpp | |
parent | ab38e4b50268633f037a10841fdfb612513f8d33 (diff) |
Support initalisers for more than just int-typed static variables.
We now use the CodeGenModule logic for generating the constant
initialiser expression, so happily further initialiser fixes should
automatically work for statics as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44495 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen/CodeGenModule.cpp')
-rw-r--r-- | CodeGen/CodeGenModule.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/CodeGen/CodeGenModule.cpp b/CodeGen/CodeGenModule.cpp index e4d0f47b0c..171a70c5a0 100644 --- a/CodeGen/CodeGenModule.cpp +++ b/CodeGen/CodeGenModule.cpp @@ -275,9 +275,8 @@ static llvm::Constant *GenerateConstantExpr(const Expr* Expression, return 0; } -llvm::Constant *CodeGenModule::EmitGlobalInit(const FileVarDecl *D, - llvm::GlobalVariable *GV) { - return GenerateConstantExpr(D->getInit(), *this); +llvm::Constant *CodeGenModule::EmitGlobalInit(const Expr *Expression) { + return GenerateConstantExpr(Expression, *this); } void CodeGenModule::EmitGlobalVar(const FileVarDecl *D) { @@ -300,7 +299,7 @@ void CodeGenModule::EmitGlobalVar(const FileVarDecl *D) { } if (!Init) - Init = EmitGlobalInit(D, GV); + Init = EmitGlobalInit(D->getInit()); assert(Init && "FIXME: Global variable initializers unimp!"); |