diff options
author | John McCall <rjmccall@apple.com> | 2012-03-30 07:09:50 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2012-03-30 07:09:50 +0000 |
commit | 49d26d2817180ccde605c987f79cd3a5b57639cd (patch) | |
tree | e300661d68dad6d9ccfb244cfa16a59be22944d9 /lib/CodeGen/CodeGenFunction.h | |
parent | 5aeaca3fa755cddba583842e7a0c3e168bf71b4d (diff) |
Do the static-locals thing properly in the face of unions and
other things which might mess with the variable's type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153733 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | lib/CodeGen/CodeGenFunction.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index 85cbd143d8..02346cf026 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -2392,17 +2392,17 @@ public: /// CreateStaticVarDecl - Create a zero-initialized LLVM global for /// a static local variable. - llvm::GlobalVariable *CreateStaticVarDecl(const VarDecl &D, - const char *Separator, - llvm::GlobalValue::LinkageTypes Linkage); + llvm::Constant *CreateStaticVarDecl(const VarDecl &D, + const char *Separator, + llvm::GlobalValue::LinkageTypes Linkage); - /// AddInitializerToStaticVarDecl - Add the initializer for 'D' to the - /// global variable that has already been created for it. If the initializer - /// has a different type than GV does, this may free GV and return a different - /// one. Otherwise it just returns GV. - llvm::GlobalVariable * - AddInitializerToStaticVarDecl(const VarDecl &D, - llvm::GlobalVariable *GV); + /// AddInitializerToStaticVarDecl - Add the initializer for 'D' to + /// the global variable that has already been created for it. If + /// the initializer has a different type than GV does, this may + /// force the underlying variable to change. Otherwise it just + /// returns it. + llvm::Constant * + AddInitializerToStaticVarDecl(const VarDecl &D, llvm::Constant *GV); /// EmitCXXGlobalVarDeclInit - Create the initializer for a C++ @@ -2420,7 +2420,7 @@ public: /// possible to prove that an initialization will be done exactly /// once, e.g. with a static local variable or a static data member /// of a class template. - void EmitCXXGuardedInit(const VarDecl &D, llvm::GlobalVariable *DeclPtr, + void EmitCXXGuardedInit(const VarDecl &D, llvm::Constant *addr, bool PerformInit); /// GenerateCXXGlobalInitFunc - Generates code for initializing global |