From 38e2496497b591db7d1c11d8f78ccff9efb71429 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Tue, 16 Oct 2012 07:22:28 +0000 Subject: 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 --- clang/lib/CodeGen/CGObjC.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'clang/lib/CodeGen/CGObjC.cpp') diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp index cea97317889..0fa70e7d3d2 100644 --- a/clang/lib/CodeGen/CGObjC.cpp +++ b/clang/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()) - DebugInfo = CGM.getModuleDebugInfo(); + if (!OMD->hasAttr()) + 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()); -- cgit v1.2.3