aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.h
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
commita240df2ec1b374b3e9e7f760875ffb17cd64506f (patch)
tree0c50fd11eb536e89c6c9cb863924bcf5952772dd /lib/CodeGen/CodeGenFunction.h
parenta6375560645177168099f1a1d96be8fa4718aa8e (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/CodeGenFunction.h')
-rw-r--r--lib/CodeGen/CodeGenFunction.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
index f24191b871..65fa87f582 100644
--- a/lib/CodeGen/CodeGenFunction.h
+++ b/lib/CodeGen/CodeGenFunction.h
@@ -1212,6 +1212,14 @@ public:
CodeGenTypes &getTypes() const { return CGM.getTypes(); }
ASTContext &getContext() const { return CGM.getContext(); }
+ /// Returns true if DebugInfo is actually initialized.
+ bool maybeInitializeDebugInfo() {
+ if (CGM.getModuleDebugInfo()) {
+ DebugInfo = CGM.getModuleDebugInfo();
+ return true;
+ }
+ return false;
+ }
CGDebugInfo *getDebugInfo() {
if (DisableDebugInfo)
return NULL;