diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-08-26 20:33:21 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-08-26 20:33:21 +0000 |
commit | 92848dee31fe0ef6c545f31f11637b594077a5cd (patch) | |
tree | 51a40169a125109841da37b6397b3386d0209f0a /clang/lib/CodeGen/CGObjC.cpp | |
parent | 41f568223a52a145dcd9fd38e80a846778d4b3f6 (diff) | |
download | bcm5719-llvm-92848dee31fe0ef6c545f31f11637b594077a5cd.tar.gz bcm5719-llvm-92848dee31fe0ef6c545f31f11637b594077a5cd.zip |
Simplify/clean up debug info suppression in CodeGenFunction
CodeGenFunction is run on only one function - a new object is made for
each new function. I would add an assertion/flag to this effect, but
there's an exception: ObjC properties involve emitting helper functions
that are all emitted by the same CodeGenFunction object, so such a check
is not possible/correct.
llvm-svn: 189277
Diffstat (limited to 'clang/lib/CodeGen/CGObjC.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGObjC.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp index 713509bf673..b5ac97f5842 100644 --- a/clang/lib/CodeGen/CGObjC.cpp +++ b/clang/lib/CodeGen/CGObjC.cpp @@ -468,8 +468,8 @@ void CodeGenFunction::StartObjCMethod(const ObjCMethodDecl *OMD, SourceLocation StartLoc) { FunctionArgList args; // Check if we should generate debug info for this method. - if (!OMD->hasAttr<NoDebugAttr>()) - maybeInitializeDebugInfo(); + if (OMD->hasAttr<NoDebugAttr>()) + DebugInfo = NULL; // disable debug info indefinitely for this function llvm::Function *Fn = CGM.getObjCRuntime().GenerateMethod(OMD, CD); @@ -2905,9 +2905,6 @@ CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction( "__assign_helper_atomic_property_", &CGM.getModule()); - // Initialize debug info if needed. - maybeInitializeDebugInfo(); - StartFunction(FD, C.VoidTy, Fn, FI, args, SourceLocation()); DeclRefExpr DstExpr(&dstDecl, false, DestTy, @@ -2988,9 +2985,6 @@ CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction( llvm::Function::Create(LTy, llvm::GlobalValue::InternalLinkage, "__copy_helper_atomic_property_", &CGM.getModule()); - // Initialize debug info if needed. - maybeInitializeDebugInfo(); - StartFunction(FD, C.VoidTy, Fn, FI, args, SourceLocation()); DeclRefExpr SrcExpr(&srcDecl, false, SrcTy, |