summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 8723a668721..5451d4afc02 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -116,6 +116,15 @@ void CodeGenFunction::EmitStaticBlockVarDecl(const VarDecl &D) {
}
DMEntry = GV;
+
+ // Emit global variable debug descriptor for static vars.
+ CGDebugInfo *DI = CGM.getDebugInfo();
+ if(DI) {
+ if(D.getLocation().isValid())
+ DI->setLocation(D.getLocation());
+ DI->EmitGlobalVariable(static_cast<llvm::GlobalVariable *>(GV), &D);
+ }
+
}
/// EmitLocalBlockVarDecl - Emit code and set up an entry in LocalDeclMap for a
OpenPOWER on IntegriCloud