diff options
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter.cpp | 11 |
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 |