summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-05-26 17:29:32 +0000
committerDevang Patel <dpatel@apple.com>2010-05-26 17:29:32 +0000
commit5a5e0bc3b578ee4cba917927870be76f97981a14 (patch)
treee315bb12300bd915750b18456590ed7ae57125c7 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parent7de379467e3e3db7f56805b21617bd24b87cf024 (diff)
downloadbcm5719-llvm-5a5e0bc3b578ee4cba917927870be76f97981a14.tar.gz
bcm5719-llvm-5a5e0bc3b578ee4cba917927870be76f97981a14.zip
Do not construct location list backword!
llvm-svn: 104705
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index afa0fa16bd2..231f63c1bc5 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2215,22 +2215,26 @@ void DwarfDebug::collectVariableInfo(const MachineFunction *MF) {
RegVar->setDotDebugLocOffset(DotDebugLocEntries.size());
if (DotDebugLocEntries.empty())
DotDebugLocEntries.push_back(DotDebugLocEntry());
- const MachineInstr *Current = MultipleValues.back();
- MultipleValues.pop_back();
- while (!MultipleValues.empty()) {
- const MachineInstr *Next = MultipleValues.back();
- MultipleValues.pop_back();
- DbgValueStartMap[Next] = RegVar;
+ const MachineInstr *Begin = NULL;
+ const MachineInstr *End = NULL;
+ for (SmallVector<const MachineInstr *, 4>::iterator
+ MVI = MultipleValues.begin(), MVE = MultipleValues.end(); MVI != MVE; ++MVI) {
+ if (!Begin) {
+ Begin = *MVI;
+ continue;
+ }
+ End = *MVI;
+ DbgValueStartMap[End] = RegVar;
MachineLocation MLoc;
- MLoc.set(Current->getOperand(0).getReg(), 0);
- const MCSymbol *FLabel = getLabelBeforeInsn(Next);
- const MCSymbol *SLabel = getLabelBeforeInsn(Current);
+ MLoc.set(Begin->getOperand(0).getReg(), 0);
+ const MCSymbol *FLabel = getLabelBeforeInsn(Begin);
+ const MCSymbol *SLabel = getLabelBeforeInsn(End);
DotDebugLocEntries.push_back(DotDebugLocEntry(FLabel, SLabel, MLoc));
- Current = Next;
- if (MultipleValues.empty()) {
- // If Next is the last instruction then its value is valid
+ Begin = End;
+ if (MVI + 1 == MVE) {
+ // If End is the last instruction then its value is valid
// until the end of the funtion.
- MLoc.set(Next->getOperand(0).getReg(), 0);
+ MLoc.set(End->getOperand(0).getReg(), 0);
DotDebugLocEntries.
push_back(DotDebugLocEntry(SLabel, FunctionEndSym, MLoc));
}
OpenPOWER on IntegriCloud