diff options
author | Sanjiv Gupta <sanjiv.gupta@microchip.com> | 2008-06-05 08:59:10 +0000 |
---|---|---|
committer | Sanjiv Gupta <sanjiv.gupta@microchip.com> | 2008-06-05 08:59:10 +0000 |
commit | 686226b538e72c5059ab7c9a8f87eb883193b645 (patch) | |
tree | 0d3a39d13a5fc72961c8dc4950a9248cdc1337cf /lib/CodeGen/CodeGenModule.cpp | |
parent | 74199b6507ff0094b74841620063d88c9669e2d7 (diff) |
Emit debug information for global and static variables when -g is specified.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51993 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 5be6872a1e..b802ce7d97 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/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 |