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/CGObjC.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/CGObjC.cpp')
-rw-r--r-- | lib/CodeGen/CGObjC.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp index cea9731788..0fa70e7d3d 100644 --- a/lib/CodeGen/CGObjC.cpp +++ b/lib/CodeGen/CGObjC.cpp @@ -440,8 +440,8 @@ void CodeGenFunction::StartObjCMethod(const ObjCMethodDecl *OMD, SourceLocation StartLoc) { FunctionArgList args; // Check if we should generate debug info for this method. - if (CGM.getModuleDebugInfo() && !OMD->hasAttr<NoDebugAttr>()) - DebugInfo = CGM.getModuleDebugInfo(); + if (!OMD->hasAttr<NoDebugAttr>()) + maybeInitializeDebugInfo(); llvm::Function *Fn = CGM.getObjCRuntime().GenerateMethod(OMD, CD); @@ -2830,9 +2830,8 @@ CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction( "__assign_helper_atomic_property_", &CGM.getModule()); - if (CGM.getModuleDebugInfo()) - DebugInfo = CGM.getModuleDebugInfo(); - + // Initialize debug info if needed. + maybeInitializeDebugInfo(); StartFunction(FD, C.VoidTy, Fn, FI, args, SourceLocation()); @@ -2916,9 +2915,8 @@ CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction( llvm::Function::Create(LTy, llvm::GlobalValue::InternalLinkage, "__copy_helper_atomic_property_", &CGM.getModule()); - if (CGM.getModuleDebugInfo()) - DebugInfo = CGM.getModuleDebugInfo(); - + // Initialize debug info if needed. + maybeInitializeDebugInfo(); StartFunction(FD, C.VoidTy, Fn, FI, args, SourceLocation()); |