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/CodeGenFunction.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/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index da8db172f50..20352f9f685 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -31,25 +31,23 @@ using namespace clang; using namespace CodeGen; CodeGenFunction::CodeGenFunction(CodeGenModule &cgm, bool suppressNewContext) - : CodeGenTypeCache(cgm), CGM(cgm), Target(cgm.getTarget()), - Builder(cgm.getModule().getContext()), - CapturedStmtInfo(0), - SanitizePerformTypeCheck(CGM.getSanOpts().Null | - CGM.getSanOpts().Alignment | - CGM.getSanOpts().ObjectSize | - CGM.getSanOpts().Vptr), - SanOpts(&CGM.getSanOpts()), - AutoreleaseResult(false), BlockInfo(0), BlockPointer(0), - LambdaThisCaptureField(0), NormalCleanupDest(0), NextCleanupDestIndex(1), - FirstBlockInfo(0), EHResumeBlock(0), ExceptionSlot(0), EHSelectorSlot(0), - DebugInfo(0), DisableDebugInfo(false), DidCallStackSave(false), - IndirectBranch(0), SwitchInsn(0), CaseRangeBlock(0), UnreachableBlock(0), - NumReturnExprs(0), NumSimpleReturnExprs(0), - CXXABIThisDecl(0), CXXABIThisValue(0), CXXThisValue(0), - CXXDefaultInitExprThis(0), - CXXStructorImplicitParamDecl(0), CXXStructorImplicitParamValue(0), - OutermostConditional(0), CurLexicalScope(0), TerminateLandingPad(0), - TerminateHandler(0), TrapBB(0) { + : CodeGenTypeCache(cgm), CGM(cgm), Target(cgm.getTarget()), + Builder(cgm.getModule().getContext()), CapturedStmtInfo(0), + SanitizePerformTypeCheck(CGM.getSanOpts().Null | + CGM.getSanOpts().Alignment | + CGM.getSanOpts().ObjectSize | + CGM.getSanOpts().Vptr), + SanOpts(&CGM.getSanOpts()), AutoreleaseResult(false), BlockInfo(0), + BlockPointer(0), LambdaThisCaptureField(0), NormalCleanupDest(0), + NextCleanupDestIndex(1), FirstBlockInfo(0), EHResumeBlock(0), + ExceptionSlot(0), EHSelectorSlot(0), DebugInfo(CGM.getModuleDebugInfo()), + DisableDebugInfo(false), DidCallStackSave(false), IndirectBranch(0), + SwitchInsn(0), CaseRangeBlock(0), UnreachableBlock(0), NumReturnExprs(0), + NumSimpleReturnExprs(0), CXXABIThisDecl(0), CXXABIThisValue(0), + CXXThisValue(0), CXXDefaultInitExprThis(0), + CXXStructorImplicitParamDecl(0), CXXStructorImplicitParamValue(0), + OutermostConditional(0), CurLexicalScope(0), TerminateLandingPad(0), + TerminateHandler(0), TrapBB(0) { if (!suppressNewContext) CGM.getCXXABI().getMangleContext().startNewFunction(); @@ -660,8 +658,8 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn, const FunctionDecl *FD = cast<FunctionDecl>(GD.getDecl()); // Check if we should generate debug info for this function. - if (!FD->hasAttr<NoDebugAttr>()) - maybeInitializeDebugInfo(); + if (FD->hasAttr<NoDebugAttr>()) + DebugInfo = NULL; // disable debug info indefinitely for this function FunctionArgList Args; QualType ResTy = FD->getResultType(); |