diff options
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | lib/CodeGen/CGDecl.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index fcea927c63..06a3343bc2 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -312,7 +312,9 @@ void CodeGenFunction::EmitStaticVarDecl(const VarDecl &D, llvm::Type *LTy = CGM.getTypes().ConvertTypeForMem(D.getType()); llvm::Type *LPtrTy = LTy->getPointerTo(CGM.getContext().getTargetAddressSpace(D.getType())); - DMEntry = llvm::ConstantExpr::getBitCast(GV, LPtrTy); + llvm::Constant *CastedVal = llvm::ConstantExpr::getBitCast(GV, LPtrTy); + DMEntry = CastedVal; + CGM.setStaticLocalDeclAddress(&D, CastedVal); // Emit global variable debug descriptor for static vars. CGDebugInfo *DI = getDebugInfo(); |