aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-13 08:05:25 +0000
committerChris Lattner <sabre@nondot.org>2010-03-13 08:05:25 +0000
commit5e6cbe0eff1249daaa02807f8cb4b33d43fdf985 (patch)
tree5c05991eaa5718fc78e0cee0585689c8795bf42a /lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
parent464bee191feb3062a63a378189e542d15bb806e2 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98432 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfPrinter.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfPrinter.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
index 3c00839aa7..8d633f3dd6 100644
--- a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
+++ b/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.