diff options
author | Alexey Samsonov <samsonov@google.com> | 2012-10-16 07:22:28 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2012-10-16 07:22:28 +0000 |
commit | a240df2ec1b374b3e9e7f760875ffb17cd64506f (patch) | |
tree | 0c50fd11eb536e89c6c9cb863924bcf5952772dd /lib/CodeGen/CGDeclCXX.cpp | |
parent | a6375560645177168099f1a1d96be8fa4718aa8e (diff) |
Transform pattern:
if (CGM.getModuleDebugInfo())
DebugInfo = CGM.getModuleDebugInfo()
into a call:
maybeInitializeDebugInfo();
This is a simplification for a possible future fix of PR13942.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166019 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDeclCXX.cpp')
-rw-r--r-- | lib/CodeGen/CGDeclCXX.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/CGDeclCXX.cpp b/lib/CodeGen/CGDeclCXX.cpp index 77d91a3a97..9f7ee1ecee 100644 --- a/lib/CodeGen/CGDeclCXX.cpp +++ b/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(), |