summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-06-20 01:00:07 +0000
committerDevang Patel <dpatel@apple.com>2009-06-20 01:00:07 +0000
commit1b61c2a1ce07fe90c3ed2ed97d4c5a7aed6bb259 (patch)
tree7a1f9fe9f5f4b9b04bf5d3657ef60b8476e7e866
parentfec52635f0d5ebe6eaa64fcdd66f60166d9ae823 (diff)
downloadbcm5719-llvm-1b61c2a1ce07fe90c3ed2ed97d4c5a7aed6bb259.tar.gz
bcm5719-llvm-1b61c2a1ce07fe90c3ed2ed97d4c5a7aed6bb259.zip
Initialize MMI
llvm-svn: 73813
-rw-r--r--llvm/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp4
-rw-r--r--llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp7
-rw-r--r--llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h1
3 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
index 08ae3bf943b..c7bfb6d1a1a 100644
--- a/llvm/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
+++ b/llvm/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
@@ -647,6 +647,8 @@ bool PPCLinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
bool PPCLinuxAsmPrinter::doInitialization(Module &M) {
bool Result = AsmPrinter::doInitialization(M);
DW = getAnalysisIfAvailable<DwarfWriter>();
+ MMI = getAnalysisIfAvailable<MachineModuleInfo>();
+ assert(MMI);
SwitchToSection(TAI->getTextSection());
return Result;
}
@@ -865,6 +867,8 @@ bool PPCDarwinAsmPrinter::doInitialization(Module &M) {
bool Result = AsmPrinter::doInitialization(M);
DW = getAnalysisIfAvailable<DwarfWriter>();
+ MMI = getAnalysisIfAvailable<MachineModuleInfo>();
+ assert(MMI);
// Prime text sections so they are adjacent. This reduces the likelihood a
// large data or debug section causes a branch to exceed 16M limit.
diff --git a/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
index 44d817de022..a34b6750332 100644
--- a/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
+++ b/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
@@ -803,6 +803,13 @@ void X86ATTAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
printInstruction(MI);
}
+/// doInitialization
+bool X86ATTAsmPrinter::doInitialization(Module &M) {
+ if (TAI->doesSupportDebugInformation() || TAI->doesSupportExceptionHandling())
+ MMI = getAnalysisIfAvailable<MachineModuleInfo>();
+ return AsmPrinter::doInitialization(M);
+}
+
void X86ATTAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
const TargetData *TD = TM.getTargetData();
diff --git a/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h b/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h
index 31c7a1f044e..fb3a354ec58 100644
--- a/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h
+++ b/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h
@@ -55,6 +55,7 @@ class VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter {
AsmPrinter::getAnalysisUsage(AU);
}
+ bool doInitialization(Module &M);
bool doFinalization(Module &M);
/// printInstruction - This method is automatically generated by tablegen
OpenPOWER on IntegriCloud