aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r--lib/CodeGen/CGDecl.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index 2ae7e225eb..e3e7fd2103 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/lib/CodeGen/CGDecl.cpp
@@ -104,7 +104,8 @@ CodeGenFunction::CreateStaticBlockVarDecl(const VarDecl &D,
}
const llvm::Type *LTy = CGM.getTypes().ConvertTypeForMem(Ty);
- return new llvm::GlobalVariable(LTy, Ty.isConstant(getContext()), Linkage,
+ return new llvm::GlobalVariable(CGM.getModule().getContext(),
+ LTy, Ty.isConstant(getContext()), Linkage,
llvm::Constant::getNullValue(LTy), Name,
&CGM.getModule(), D.isThreadSpecified(),
Ty.getAddressSpace());
@@ -149,7 +150,8 @@ void CodeGenFunction::EmitStaticBlockVarDecl(const VarDecl &D) {
if (GV->getType() != Init->getType()) {
llvm::GlobalVariable *OldGV = GV;
- GV = new llvm::GlobalVariable(Init->getType(), OldGV->isConstant(),
+ GV = new llvm::GlobalVariable(CGM.getModule().getContext(),
+ Init->getType(), OldGV->isConstant(),
OldGV->getLinkage(), Init, "",
&CGM.getModule(), D.isThreadSpecified(),
D.getType().getAddressSpace());