summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 5be6872a1ec..b802ce7d97c 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -739,6 +739,14 @@ void CodeGenModule::EmitGlobalVarInit(const VarDecl *D) {
break;
}
}
+
+ // Emit global variable debug information.
+ CGDebugInfo *DI = getDebugInfo();
+ if(DI) {
+ if(D->getLocation().isValid())
+ DI->setLocation(D->getLocation());
+ DI->EmitGlobalVariable(GV, D);
+ }
}
/// EmitGlobalVarDeclarator - Emit all the global vars attached to the specified
OpenPOWER on IntegriCloud