aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-02-04 23:06:48 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-02-04 23:06:48 +0000
commit4e3f5a4e9c13f216856515e6f000881f2c850736 (patch)
tree1864bd1e96863458c4ba320b1d655c00c6fff8e7 /lib/CodeGen
parentc451ac0a42f06355976e5d7d8bc45da16474e3f0 (diff)
Dwarf requires variable entries to be in the source order. Right now, since we are recording variable information at isel time this means parameters would appear in the reverse order. The short term fix is to issue recordVariable() at asm printing time instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46724 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp
index f581bd6272..820d75c4a0 100644
--- a/lib/CodeGen/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter.cpp
@@ -118,9 +118,8 @@ bool AsmPrinter::doInitialization(Module &M) {
SwitchToDataSection(""); // Reset back to no section.
- if (MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>()) {
- MMI->AnalyzeModule(M);
- }
+ MMI = getAnalysisToUpdate<MachineModuleInfo>();
+ if (MMI) MMI->AnalyzeModule(M);
return false;
}
@@ -1291,8 +1290,12 @@ void AsmPrinter::printLabel(unsigned Id) const {
/// printDeclare - This method prints a local variable declaration used by
/// debug tables.
+/// FIXME: It doesn't really print anything rather it inserts a DebugVariable
+/// entry into dwarf table.
void AsmPrinter::printDeclare(const MachineInstr *MI) const {
- // Do nothing.
+ int FI = MI->getOperand(0).getIndex();
+ GlobalValue *GV = MI->getOperand(1).getGlobal();
+ MMI->RecordVariable(GV, FI);
}
/// PrintAsmOperand - Print the specified operand of MI, an INLINEASM