diff options
author | Bill Wendling <isanbard@gmail.com> | 2009-02-17 01:04:54 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2009-02-17 01:04:54 +0000 |
commit | 86e6cb924b85e7a288a4d8bfde5d1a8fb9810c88 (patch) | |
tree | c3e72b8f2057840adab445095bd46766d9fdddc8 /lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | |
parent | 1236df4aaa571461301eaa40c56de559a5a4f2f0 (diff) |
--- Merging (from foreign repository) r64714 into '.':
U include/llvm/CodeGen/DebugLoc.h
U lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
U lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
U lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
Enable debug location generation at -Os. This goes with the reapplication of the
r63639 patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64715 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index 6139638dab..60e8f34651 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp @@ -3915,8 +3915,12 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { if (DW && DW->ValidDebugInfo(RSI.getContext())) { unsigned LabelID = DW->RecordRegionStart(cast<GlobalVariable>(RSI.getContext())); - DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(), - getRoot(), LabelID)); + const Function *F = I.getParent()->getParent(); + + // FIXME: Support more than just -Os. + if (!F->hasFnAttr(Attribute::OptimizeForSize)) + DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(), + getRoot(), LabelID)); } return 0; @@ -3927,8 +3931,12 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { if (DW && DW->ValidDebugInfo(REI.getContext())) { unsigned LabelID = DW->RecordRegionEnd(cast<GlobalVariable>(REI.getContext())); - DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(), - getRoot(), LabelID)); + const Function *F = I.getParent()->getParent(); + + // FIXME: Support more than just -Os. + if (!F->hasFnAttr(Attribute::OptimizeForSize)) + DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(), + getRoot(), LabelID)); } return 0; @@ -3950,28 +3958,36 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { // function start. It will be emitted at asm emission time. However, // create a label if this is a beginning of inlined function. unsigned Line = Subprogram.getLineNumber(); - unsigned LabelID = DW->RecordSourceLine(Line, 0, SrcFile); - if (DW->getRecordSourceLineCount() != 1) - DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(), - getRoot(), LabelID)); + // FIXME: Support more than just -Os. + const Function *F = I.getParent()->getParent(); + if (!F->hasFnAttr(Attribute::OptimizeForSize)) { + unsigned LabelID = DW->RecordSourceLine(Line, 0, SrcFile); + if (DW->getRecordSourceLineCount() != 1) + DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(), + getRoot(), LabelID)); + } setCurDebugLoc(DebugLoc::get(DAG.getMachineFunction(). - getOrCreateDebugLocID(SrcFile, Line, 0))); + getOrCreateDebugLocID(SrcFile, Line, 0))); } return 0; } case Intrinsic::dbg_declare: { - DwarfWriter *DW = DAG.getDwarfWriter(); - DbgDeclareInst &DI = cast<DbgDeclareInst>(I); - Value *Variable = DI.getVariable(); - if (DW && DW->ValidDebugInfo(Variable)) - DAG.setRoot(DAG.getNode(ISD::DECLARE, dl, MVT::Other, getRoot(), - getValue(DI.getAddress()), getValue(Variable))); + const Function *F = I.getParent()->getParent(); + if (!F->hasFnAttr(Attribute::OptimizeForSize)) { + DwarfWriter *DW = DAG.getDwarfWriter(); + DbgDeclareInst &DI = cast<DbgDeclareInst>(I); + Value *Variable = DI.getVariable(); + if (DW && DW->ValidDebugInfo(Variable)) + DAG.setRoot(DAG.getNode(ISD::DECLARE, dl, MVT::Other, getRoot(), + getValue(DI.getAddress()), getValue(Variable))); + } else { + // FIXME: Do something sensible here when we support debug declare. + } return 0; } - case Intrinsic::eh_exception: { if (!CurMBB->isLandingPad()) { // FIXME: Mark exception register as live in. Hack for PR1508. |