summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter.cpp
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
commit2cb9068c78d4f0d5caff25ecb0bbc59cf655f898 (patch)
treeab9175fac35625a6e405b9c4419bcc15c4ad6cc2 /llvm/lib/CodeGen/AsmPrinter.cpp
parent5420516b3f9abaf6d3b9876b5150e66112cd2197 (diff)
downloadbcm5719-llvm-2cb9068c78d4f0d5caff25ecb0bbc59cf655f898.tar.gz
bcm5719-llvm-2cb9068c78d4f0d5caff25ecb0bbc59cf655f898.zip
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.
llvm-svn: 46724
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp
index f581bd6272d..820d75c4a0b 100644
--- a/llvm/lib/CodeGen/AsmPrinter.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud