Lift addAssemblyEmitter into LLVMTargetMachine.

- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75859 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2009-07-15 23:34:19 +00:00
parent e017fd1b20
commit 5d77cad60b
24 changed files with 19 additions and 163 deletions

View File

@ -402,15 +402,6 @@ public:
}
/// addAssemblyEmitter - This pass should be overridden by the target to add
/// the asmprinter, if asm emission is supported. If this is not supported,
/// 'true' should be returned.
virtual bool addAssemblyEmitter(PassManagerBase &, CodeGenOpt::Level,
bool /* VerboseAsmDefault */,
formatted_raw_ostream &) {
return true;
}
/// addCodeEmitter - This pass should be overridden by the target to add a
/// code emitter, if supported. If this is not supported, 'true' should be
/// returned.
@ -454,6 +445,14 @@ public:
/// getEnableTailMergeDefault - the default setting for -enable-tail-merge
/// on this target. User flag overrides.
virtual bool getEnableTailMergeDefault() const { return true; }
/// addAssemblyEmitter - Helper function which creates a target specific
/// assembly printer, if available.
///
/// \return Returns 'false' on success.
bool addAssemblyEmitter(PassManagerBase &, CodeGenOpt::Level,
bool /* VerboseAsmDefault */,
formatted_raw_ostream &);
};
} // End llvm namespace

View File

@ -92,6 +92,17 @@ LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
return FileModel::Error;
}
bool LLVMTargetMachine::addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose,
formatted_raw_ostream &Out) {
FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
if (!Printer)
llvm_report_error("unable to create assembly printer");
PM.add(Printer);
return false;
}
/// addPassesToEmitFileFinish - If the passes to emit the specified file had to
/// be split up (e.g., to add an object writer pass), this method can be used to
/// finish up adding passes to emit the file, if necessary.

View File

@ -129,18 +129,6 @@ bool ARMBaseTargetMachine::addPreEmitPass(PassManagerBase &PM,
return true;
}
bool ARMBaseTargetMachine::addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose,
formatted_raw_ostream &Out) {
FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
if (!Printer)
llvm_report_error("unable to create assembly printer");
PM.add(Printer);
return false;
}
bool ARMBaseTargetMachine::addCodeEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
MachineCodeEmitter &MCE) {

View File

@ -55,9 +55,6 @@ public:
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
virtual bool addPreRegAlloc(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
virtual bool addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose, formatted_raw_ostream &Out);
virtual bool addCodeEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,
MachineCodeEmitter &MCE);
virtual bool addCodeEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,

View File

@ -61,16 +61,6 @@ bool AlphaTargetMachine::addPreEmitPass(PassManagerBase &PM,
PM.add(createAlphaLLRPPass(*this));
return false;
}
bool AlphaTargetMachine::addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose,
formatted_raw_ostream &Out) {
FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
if (!Printer)
llvm_report_error("unable to create assembly printer");
PM.add(Printer);
return false;
}
bool AlphaTargetMachine::addCodeEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
MachineCodeEmitter &MCE) {

View File

@ -57,9 +57,6 @@ public:
// Pass Pipeline Configuration
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
virtual bool addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose, formatted_raw_ostream &Out);
virtual bool addCodeEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,
MachineCodeEmitter &MCE);
virtual bool addCodeEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,

View File

@ -72,14 +72,3 @@ SPUTargetMachine::addInstSelector(PassManagerBase &PM,
PM.add(createSPUISelDag(*this));
return false;
}
bool SPUTargetMachine::addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose,
formatted_raw_ostream &Out) {
FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
if (!Printer)
llvm_report_error("unable to create assembly printer");
PM.add(Printer);
return false;
}

View File

@ -79,9 +79,6 @@ public:
// Pass Pipeline Configuration
virtual bool addInstSelector(PassManagerBase &PM,
CodeGenOpt::Level OptLevel);
virtual bool addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose, formatted_raw_ostream &Out);
};
} // end namespace llvm

View File

@ -58,13 +58,3 @@ bool IA64TargetMachine::addPreEmitPass(PassManagerBase &PM,
PM.add(createIA64BundlingPass(*this));
return true;
}
bool IA64TargetMachine::addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose,
formatted_raw_ostream &Out) {
FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
if (!Printer)
llvm_report_error("unable to create assembly printer");
PM.add(Printer);
return false;
}

View File

@ -51,9 +51,6 @@ public:
// Pass Pipeline Configuration
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
virtual bool addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose, formatted_raw_ostream &Out);
};
} // End llvm namespace

View File

@ -63,14 +63,3 @@ bool MSP430TargetMachine::addInstSelector(PassManagerBase &PM,
return false;
}
bool MSP430TargetMachine::addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose,
formatted_raw_ostream &Out) {
FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
if (!Printer)
llvm_report_error("unable to create assembly printer");
PM.add(Printer);
return false;
}

View File

@ -57,9 +57,6 @@ public:
}
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
virtual bool addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel, bool Verbose,
formatted_raw_ostream &Out);
}; // MSP430TargetMachine.
} // end namespace llvm

View File

@ -94,15 +94,3 @@ addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel)
PM.add(createMipsDelaySlotFillerPass(*this));
return true;
}
// Implements the AssemblyEmitter for the target. Must return
// true if AssemblyEmitter is supported
bool MipsTargetMachine::
addAssemblyEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,
bool Verbose, formatted_raw_ostream &Out) {
FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
if (!Printer)
llvm_report_error("unable to create assembly printer");
PM.add(Printer);
return false;
}

View File

@ -60,9 +60,6 @@ namespace llvm {
CodeGenOpt::Level OptLevel);
virtual bool addPreEmitPass(PassManagerBase &PM,
CodeGenOpt::Level OptLevel);
virtual bool addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose, formatted_raw_ostream &Out);
};
/// MipselTargetMachine - Mipsel target machine.

View File

@ -75,17 +75,6 @@ bool PIC16TargetMachine::addInstSelector(PassManagerBase &PM,
return false;
}
bool PIC16TargetMachine::addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose,
formatted_raw_ostream &Out) {
FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
if (!Printer)
llvm_report_error("unable to create assembly printer");
PM.add(Printer);
return false;
}
bool PIC16TargetMachine::addPostRegAlloc(PassManagerBase &PM,
CodeGenOpt::Level OptLevel) {
PM.add(createPIC16MemSelOptimizerPass());

View File

@ -59,9 +59,6 @@ public:
virtual bool addInstSelector(PassManagerBase &PM,
CodeGenOpt::Level OptLevel);
virtual bool addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose, formatted_raw_ostream &Out);
virtual bool addPostRegAlloc(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
}; // PIC16TargetMachine.

View File

@ -98,17 +98,6 @@ bool PPCTargetMachine::addPreEmitPass(PassManagerBase &PM,
return false;
}
bool PPCTargetMachine::addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose,
formatted_raw_ostream &Out) {
FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
if (!Printer)
llvm_report_error("unable to create assembly printer");
PM.add(Printer);
return false;
}
bool PPCTargetMachine::addCodeEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
MachineCodeEmitter &MCE) {

View File

@ -68,9 +68,6 @@ public:
// Pass Pipeline Configuration
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
virtual bool addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose, formatted_raw_ostream &Out);
virtual bool addCodeEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,
MachineCodeEmitter &MCE);
virtual bool addCodeEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,

View File

@ -55,14 +55,3 @@ bool SparcTargetMachine::addPreEmitPass(PassManagerBase &PM,
PM.add(createSparcDelaySlotFillerPass(*this));
return true;
}
bool SparcTargetMachine::addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose,
formatted_raw_ostream &Out) {
FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
if (!Printer)
llvm_report_error("unable to create assembly printer");
PM.add(Printer);
return false;
}

View File

@ -52,9 +52,6 @@ public:
// Pass Pipeline Configuration
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
virtual bool addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose, formatted_raw_ostream &Out);
};
} // end namespace llvm

View File

@ -181,17 +181,6 @@ bool X86TargetMachine::addPostRegAlloc(PassManagerBase &PM,
return true; // -print-machineinstr should print after this.
}
bool X86TargetMachine::addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose,
formatted_raw_ostream &Out) {
FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
if (!Printer)
llvm_report_error("unable to create assembly printer");
PM.add(Printer);
return false;
}
bool X86TargetMachine::addCodeEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
MachineCodeEmitter &MCE) {

View File

@ -64,9 +64,6 @@ public:
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
virtual bool addPreRegAlloc(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
virtual bool addPostRegAlloc(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
virtual bool addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose, formatted_raw_ostream &Out);
virtual bool addCodeEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,
MachineCodeEmitter &MCE);
virtual bool addCodeEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,

View File

@ -60,14 +60,3 @@ bool XCoreTargetMachine::addInstSelector(PassManagerBase &PM,
PM.add(createXCoreISelDag(*this));
return false;
}
bool XCoreTargetMachine::addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose,
formatted_raw_ostream &Out) {
FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
if (!Printer)
llvm_report_error("unable to create assembly printer");
PM.add(Printer);
return false;
}

View File

@ -52,9 +52,6 @@ public:
// Pass Pipeline Configuration
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
virtual bool addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose, formatted_raw_ostream &Out);
};
} // end namespace llvm