Update due to mainline API change

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70769 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov 2009-05-03 13:19:42 +00:00
parent 7594884648
commit 60871cb40c
5 changed files with 29 additions and 19 deletions

View File

@ -15,15 +15,19 @@
#ifndef LLVM_TARGET_MSP430_H
#define LLVM_TARGET_MSP430_H
#include "llvm/Target/TargetMachine.h"
namespace llvm {
class MSP430TargetMachine;
class FunctionPass;
class raw_ostream;
FunctionPass *createMSP430ISelDag(MSP430TargetMachine &TM);
FunctionPass *createMSP430CodePrinterPass(raw_ostream &OS,
MSP430TargetMachine &TM,
bool Fast, bool Verbose);
FunctionPass *createMSP430ISelDag(MSP430TargetMachine &TM,
CodeGenOpt::Level OptLevel);
FunctionPass *createMSP430CodePrinterPass(raw_ostream &o,
MSP430TargetMachine &tm,
CodeGenOpt::Level OptLevel,
bool verbose);
} // end namespace llvm;
// Defines symbolic names for MSP430 registers.

View File

@ -40,8 +40,9 @@ namespace {
class VISIBILITY_HIDDEN MSP430AsmPrinter : public AsmPrinter {
public:
MSP430AsmPrinter(raw_ostream &O, MSP430TargetMachine &TM,
const TargetAsmInfo *TAI, bool Fast, bool Verbose)
: AsmPrinter(O, TM, TAI, Fast, Verbose) {}
const TargetAsmInfo *TAI,
CodeGenOpt::Level OL, bool V)
: AsmPrinter(O, TM, TAI, OL, V) {}
virtual const char *getPassName() const {
return "MSP430 Assembly Printer";
@ -76,8 +77,9 @@ namespace {
///
FunctionPass *llvm::createMSP430CodePrinterPass(raw_ostream &o,
MSP430TargetMachine &tm,
bool fast, bool verbose) {
return new MSP430AsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose);
CodeGenOpt::Level OptLevel,
bool verbose) {
return new MSP430AsmPrinter(o, tm, tm.getTargetAsmInfo(), OptLevel, verbose);
}
bool MSP430AsmPrinter::doInitialization(Module &M) {

View File

@ -41,8 +41,8 @@ namespace {
const MSP430Subtarget &Subtarget;
public:
MSP430DAGToDAGISel(MSP430TargetMachine &TM)
: SelectionDAGISel(TM),
MSP430DAGToDAGISel(MSP430TargetMachine &TM, CodeGenOpt::Level OptLevel)
: SelectionDAGISel(TM, OptLevel),
Lowering(*TM.getTargetLowering()),
Subtarget(*TM.getSubtargetImpl()) { }
@ -68,8 +68,9 @@ namespace {
/// createMSP430ISelDag - This pass converts a legalized DAG into a
/// MSP430-specific DAG, ready for instruction scheduling.
///
FunctionPass *llvm::createMSP430ISelDag(MSP430TargetMachine &TM) {
return new MSP430DAGToDAGISel(TM);
FunctionPass *llvm::createMSP430ISelDag(MSP430TargetMachine &TM,
CodeGenOpt::Level OptLevel) {
return new MSP430DAGToDAGISel(TM, OptLevel);
}
// FIXME: This is pretty dummy routine and needs to be rewritten in the future.

View File

@ -47,17 +47,19 @@ const TargetAsmInfo *MSP430TargetMachine::createTargetAsmInfo() const {
return new MSP430TargetAsmInfo(*this);
}
bool MSP430TargetMachine::addInstSelector(PassManagerBase &PM, bool Fast) {
bool MSP430TargetMachine::addInstSelector(PassManagerBase &PM,
CodeGenOpt::Level OptLevel) {
// Install an instruction selector.
PM.add(createMSP430ISelDag(*this));
PM.add(createMSP430ISelDag(*this, OptLevel));
return false;
}
bool MSP430TargetMachine::addAssemblyEmitter(PassManagerBase &PM,
bool Fast, bool Verbose,
CodeGenOpt::Level OptLevel,
bool Verbose,
raw_ostream &Out) {
// Output assembly language.
PM.add(createMSP430CodePrinterPass(Out, *this, Fast, Verbose));
PM.add(createMSP430CodePrinterPass(Out, *this, OptLevel, Verbose));
return false;
}

View File

@ -56,9 +56,10 @@ public:
return const_cast<MSP430TargetLowering*>(&TLInfo);
}
virtual bool addInstSelector(PassManagerBase &PM, bool Fast);
virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast,
bool Verbose, raw_ostream &Out);
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
virtual bool addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel, bool Verbose,
raw_ostream &Out);
static unsigned getModuleMatchQuality(const Module &M);
}; // MSP430TargetMachine.