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 | aefc8fd41588360dd06cc4727efc5784bbcd3690 (patch) | |
| tree | 6ed25943d1c0655439f75d2fa6571e08e6e67558 /clang/CodeGen/CodeGenModule.cpp | |
| parent | 3e41367dd513cf5c1342537810114dc221da4f73 (diff) | |
| download | bcm5719-llvm-aefc8fd41588360dd06cc4727efc5784bbcd3690.tar.gz bcm5719-llvm-aefc8fd41588360dd06cc4727efc5784bbcd3690.zip | |
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.
llvm-svn: 44495
Diffstat (limited to 'clang/CodeGen/CodeGenModule.cpp')
| -rw-r--r-- | clang/CodeGen/CodeGenModule.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/CodeGen/CodeGenModule.cpp b/clang/CodeGen/CodeGenModule.cpp index e4d0f47b0c3..171a70c5a0c 100644 --- a/clang/CodeGen/CodeGenModule.cpp +++ b/clang/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!"); |

