diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-03-13 08:05:25 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-03-13 08:05:25 +0000 |
| commit | 41e275dc8ed20cdfe08ac27e31b13b5c38750a14 (patch) | |
| tree | 658298cafd94b613828590aa0c125a386814595a /llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp | |
| parent | 5bb8207c13db9fb2c862f8afe9a02200f5541159 (diff) | |
| download | bcm5719-llvm-41e275dc8ed20cdfe08ac27e31b13b5c38750a14.tar.gz bcm5719-llvm-41e275dc8ed20cdfe08ac27e31b13b5c38750a14.zip | |
simplify EmitFrameMoves to take BaseLabel in as a symbol
instead of as a stem+idx pair, simplify the "is a new
location" check to use symbol comparison.
llvm-svn: 98432
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp index 3c00839aa77..8d633f3dd6a 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp @@ -237,7 +237,7 @@ void DwarfPrinter::EmitSectionOffset(const MCSymbol *Label, /// EmitFrameMoves - Emit frame instructions to describe the layout of the /// frame. -void DwarfPrinter::EmitFrameMoves(const char *BaseLabel, unsigned BaseLabelID, +void DwarfPrinter::EmitFrameMoves(MCSymbol *BaseLabel, const std::vector<MachineMove> &Moves, bool isEH) { int stackGrowth = TD->getPointerSize(); @@ -245,7 +245,6 @@ void DwarfPrinter::EmitFrameMoves(const char *BaseLabel, unsigned BaseLabelID, TargetFrameInfo::StackGrowsUp) stackGrowth *= -1; - bool IsLocal = false; for (unsigned i = 0, N = Moves.size(); i < N; ++i) { const MachineMove &Move = Moves[i]; unsigned LabelID = Move.getLabelID(); @@ -258,13 +257,13 @@ void DwarfPrinter::EmitFrameMoves(const char *BaseLabel, unsigned BaseLabelID, const MachineLocation &Src = Move.getSource(); // Advance row if new location. - if (BaseLabel && LabelID && (BaseLabelID != LabelID || !IsLocal)) { - EmitCFAByte(dwarf::DW_CFA_advance_loc4); - EmitDifference(getDWLabel("label", LabelID), - getDWLabel(BaseLabel, BaseLabelID), true); - BaseLabelID = LabelID; - BaseLabel = "label"; - IsLocal = true; + if (BaseLabel && LabelID) { + MCSymbol *ThisSym = getDWLabel("label", LabelID); + if (ThisSym != BaseLabel) { + EmitCFAByte(dwarf::DW_CFA_advance_loc4); + EmitDifference(ThisSym, BaseLabel, true); + BaseLabel = ThisSym; + } } // If advancing cfa. |

