summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-02-17 01:04:54 +0000
committerBill Wendling <isanbard@gmail.com>2009-02-17 01:04:54 +0000
commit3c50922ea02b8f23fa306c7e695f9eaefe8b602a (patch)
treee9e33d255beb8ebc1457654c03e3a344dc3997a1 /llvm/lib/Target
parent01c3d23814cb0432e13be553f970cf2a529811f2 (diff)
downloadbcm5719-llvm-3c50922ea02b8f23fa306c7e695f9eaefe8b602a.tar.gz
bcm5719-llvm-3c50922ea02b8f23fa306c7e695f9eaefe8b602a.zip
--- 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. llvm-svn: 64715
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
index 847355c50d7..75a34a6ec64 100644
--- a/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
+++ b/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
@@ -726,15 +726,20 @@ void X86ATTAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
++EmittedInsts;
if (TAI->doesSupportDebugInformation()) {
- static DebugLoc PrevDL = DebugLoc::getUnknownLoc();
- DebugLoc CurDL = MI->getDebugLoc();
+ const Function *F = MF->getFunction();
- if (!CurDL.isInvalid() && !CurDL.isUnknown() && PrevDL != CurDL) {
- DebugLocTuple DLT = MF->getDebugLocTuple(CurDL);
- printLabel(DW->RecordSourceLine(DLT.Line, DLT.Col, DLT.Src));
- }
+ // FIXME: Support more than '-Os'.
+ if (F->hasFnAttr(Attribute::OptimizeForSize)) {
+ static DebugLoc PrevDL = DebugLoc::getUnknownLoc();
+ DebugLoc CurDL = MI->getDebugLoc();
+
+ if (!CurDL.isUnknown() && PrevDL != CurDL) {
+ DebugLocTuple DLT = MF->getDebugLocTuple(CurDL);
+ printLabel(DW->RecordSourceLine(DLT.Line, DLT.Col, DLT.Src));
+ }
- PrevDL = CurDL;
+ PrevDL = CurDL;
+ }
}
// Call the autogenerated instruction printer routines.
OpenPOWER on IntegriCloud