From 60871cb40ce2df662e8361b1215f5a9431d54dd7 Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Sun, 3 May 2009 13:19:42 +0000 Subject: [PATCH] Update due to mainline API change git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70769 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/MSP430/MSP430.h | 12 ++++++++---- lib/Target/MSP430/MSP430AsmPrinter.cpp | 10 ++++++---- lib/Target/MSP430/MSP430ISelDAGToDAG.cpp | 9 +++++---- lib/Target/MSP430/MSP430TargetMachine.cpp | 10 ++++++---- lib/Target/MSP430/MSP430TargetMachine.h | 7 ++++--- 5 files changed, 29 insertions(+), 19 deletions(-) diff --git a/lib/Target/MSP430/MSP430.h b/lib/Target/MSP430/MSP430.h index 3fa024caed0..ed0cd0496aa 100644 --- a/lib/Target/MSP430/MSP430.h +++ b/lib/Target/MSP430/MSP430.h @@ -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. diff --git a/lib/Target/MSP430/MSP430AsmPrinter.cpp b/lib/Target/MSP430/MSP430AsmPrinter.cpp index c606112c2c6..71b785bb4fe 100644 --- a/lib/Target/MSP430/MSP430AsmPrinter.cpp +++ b/lib/Target/MSP430/MSP430AsmPrinter.cpp @@ -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) { diff --git a/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp b/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp index 91915d7559e..32e1f7a57aa 100644 --- a/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp +++ b/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp @@ -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. diff --git a/lib/Target/MSP430/MSP430TargetMachine.cpp b/lib/Target/MSP430/MSP430TargetMachine.cpp index 155f8c2bac3..78869463f3a 100644 --- a/lib/Target/MSP430/MSP430TargetMachine.cpp +++ b/lib/Target/MSP430/MSP430TargetMachine.cpp @@ -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; } diff --git a/lib/Target/MSP430/MSP430TargetMachine.h b/lib/Target/MSP430/MSP430TargetMachine.h index 258a3951ca1..d9ffa2b5ac8 100644 --- a/lib/Target/MSP430/MSP430TargetMachine.h +++ b/lib/Target/MSP430/MSP430TargetMachine.h @@ -56,9 +56,10 @@ public: return const_cast(&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.