summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDeclCXX.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-10-16 07:22:28 +0000
committerAlexey Samsonov <samsonov@google.com>2012-10-16 07:22:28 +0000
commit38e2496497b591db7d1c11d8f78ccff9efb71429 (patch)
tree9064fc8d6f0a33e6e1a4e9916c88773441327280 /clang/lib/CodeGen/CGDeclCXX.cpp
parente59a920b0c41c1e7e36a5c8d9d609aad87e4ec1e (diff)
downloadbcm5719-llvm-38e2496497b591db7d1c11d8f78ccff9efb71429.tar.gz
bcm5719-llvm-38e2496497b591db7d1c11d8f78ccff9efb71429.zip
Transform pattern:
if (CGM.getModuleDebugInfo()) DebugInfo = CGM.getModuleDebugInfo() into a call: maybeInitializeDebugInfo(); This is a simplification for a possible future fix of PR13942. llvm-svn: 166019
Diffstat (limited to 'clang/lib/CodeGen/CGDeclCXX.cpp')
-rw-r--r--clang/lib/CodeGen/CGDeclCXX.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDeclCXX.cpp b/clang/lib/CodeGen/CGDeclCXX.cpp
index 77d91a3a97d..9f7ee1ecee6 100644
--- a/clang/lib/CodeGen/CGDeclCXX.cpp
+++ b/clang/lib/CodeGen/CGDeclCXX.cpp
@@ -321,8 +321,9 @@ void CodeGenFunction::GenerateCXXGlobalVarDeclInitFunc(llvm::Function *Fn,
const VarDecl *D,
llvm::GlobalVariable *Addr,
bool PerformInit) {
- if (CGM.getModuleDebugInfo() && !D->hasAttr<NoDebugAttr>())
- DebugInfo = CGM.getModuleDebugInfo();
+ // Check if we need to emit debug info for variable initializer.
+ if (!D->hasAttr<NoDebugAttr>())
+ maybeInitializeDebugInfo();
StartFunction(GlobalDecl(D), getContext().VoidTy, Fn,
getTypes().arrangeNullaryFunction(),
OpenPOWER on IntegriCloud