X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FAsmPrinter.cpp;h=b718958f974f579f72215a878bb92a7618ae8804;hb=d497d9fab6e90499c703f3e672ec001dbfa074f9;hp=f581bd6272df9b481387fbfd958e3c4aa81f36e3;hpb=4eecdeb3faf5df864790175da5d58301b751ec11;p=oota-llvm.git diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index f581bd6272d..b718958f974 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()) { - MMI->AnalyzeModule(M); - } + MMI = getAnalysisToUpdate(); + if (MMI) MMI->AnalyzeModule(M); return false; } @@ -158,7 +157,7 @@ bool AsmPrinter::doFinalization(Module &M) { else if (!I->hasInternalLinkage()) assert(0 && "Invalid alias linkage"); - O << TAI->getSetDirective() << Name << ", " << Target << "\n"; + O << TAI->getSetDirective() << ' ' << Name << ", " << Target << "\n"; // If the aliasee has external weak linkage it can be referenced only by // alias itself. In this case it can be not in ExtWeakSymbols list. Emit @@ -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