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
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
index 85cbd14..02346cf 100644
--- a/lib/CodeGen/CodeGenFunction.h
+++ b/lib/CodeGen/CodeGenFunction.h
@@ -2392,17 +2392,17 @@
/// 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 @@
/// 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