aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-07-09 06:36:53 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-07-09 06:36:53 +0000
commit526be70f94538a2cc131ab1b0fd9f7264e00d297 (patch)
treed5f61a6c502fbd67625892662d97696c1bb826e0 /lib
parent3e30cbb457509aff5645286f29d7d34adfe625bb (diff)
Back out 53254. It broke ppc debug info codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53280 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/ARM/ARMAsmPrinter.cpp11
-rw-r--r--lib/Target/PowerPC/PPCAsmPrinter.cpp9
-rw-r--r--lib/Target/X86/X86ATTAsmPrinter.cpp18
3 files changed, 15 insertions, 23 deletions
diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp
index 25b42c5db8..23e5e37cf0 100644
--- a/lib/Target/ARM/ARMAsmPrinter.cpp
+++ b/lib/Target/ARM/ARMAsmPrinter.cpp
@@ -42,13 +42,11 @@ STATISTIC(EmittedInsts, "Number of machine instrs printed");
namespace {
struct VISIBILITY_HIDDEN ARMAsmPrinter : public AsmPrinter {
ARMAsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
- : AsmPrinter(O, TM, T), DW(O, this, T), MMI(0), AFI(NULL),
- InCPMode(false) {
+ : AsmPrinter(O, TM, T), DW(O, this, T), AFI(NULL), InCPMode(false) {
Subtarget = &TM.getSubtarget<ARMSubtarget>();
}
DwarfWriter DW;
- MachineModuleInfo *MMI;
/// Subtarget - Keep a pointer to the ARMSubtarget around so that we can
/// make the right decision when printing asm code for different targets.
@@ -178,6 +176,8 @@ FunctionPass *llvm::createARMCodePrinterPass(std::ostream &o,
bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
AFI = MF.getInfo<ARMFunctionInfo>();
+ DW.SetModuleInfo(&getAnalysis<MachineModuleInfo>());
+
SetupMachineFunction(MF);
O << "\n";
@@ -800,11 +800,6 @@ bool ARMAsmPrinter::doInitialization(Module &M) {
bool Result = AsmPrinter::doInitialization(M);
- // AsmPrinter::doInitialization should have done this analysis.
- MMI = getAnalysisToUpdate<MachineModuleInfo>();
- assert(MMI);
- DW.SetModuleInfo(MMI);
-
// Darwin wants symbols to be quoted if they have complex names.
if (Subtarget->isTargetDarwin())
Mang->setUseQuotes(true);
diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
index ae967a8d00..9c9dd391be 100644
--- a/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -790,6 +790,9 @@ std::string DarwinAsmPrinter::getSectionForFunction(const Function &F) const {
/// method to print assembly for each instruction.
///
bool DarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+ // We need this for Personality functions.
+ MMI = &getAnalysis<MachineModuleInfo>();
+ DW.SetModuleInfo(MMI);
SetupMachineFunction(MF);
O << "\n\n";
@@ -884,12 +887,6 @@ bool DarwinAsmPrinter::doInitialization(Module &M) {
bool Result = AsmPrinter::doInitialization(M);
- // We need this for Personality functions.
- // AsmPrinter::doInitialization should have done this analysis.
- MMI = getAnalysisToUpdate<MachineModuleInfo>();
- assert(MMI);
- DW.SetModuleInfo(MMI);
-
// Darwin wants symbols to be quoted if they have complex names.
Mang->setUseQuotes(true);
diff --git a/lib/Target/X86/X86ATTAsmPrinter.cpp b/lib/Target/X86/X86ATTAsmPrinter.cpp
index 4e1c1dfde1..a61bb2261d 100644
--- a/lib/Target/X86/X86ATTAsmPrinter.cpp
+++ b/lib/Target/X86/X86ATTAsmPrinter.cpp
@@ -232,6 +232,13 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
const Function *F = MF.getFunction();
unsigned CC = F->getCallingConv();
+ if (TAI->doesSupportDebugInformation()) {
+ // Let PassManager know we need debug information and relay
+ // the MachineModuleInfo address on to DwarfWriter.
+ MMI = &getAnalysis<MachineModuleInfo>();
+ DW.SetModuleInfo(MMI);
+ }
+
SetupMachineFunction(MF);
O << "\n\n";
@@ -744,20 +751,13 @@ void X86ATTAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
/// doInitialization
bool X86ATTAsmPrinter::doInitialization(Module &M) {
-
- bool Result = AsmPrinter::doInitialization(M);
-
if (TAI->doesSupportDebugInformation()) {
// Emit initial debug information.
DW.BeginModule(&M);
- // Let PassManager know we need debug information and relay
- // the MachineModuleInfo address on to DwarfWriter.
- // AsmPrinter::doInitialization should have done this analysis.
- MMI = getAnalysisToUpdate<MachineModuleInfo>();
- assert(MMI);
- DW.SetModuleInfo(MMI);
}
+ bool Result = AsmPrinter::doInitialization(M);
+
// Darwin wants symbols to be quoted if they have complex names.
if (Subtarget->isTargetDarwin())
Mang->setUseQuotes(true);