Update due to mainline API change

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70769 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/MSP430/MSP430.h b/lib/Target/MSP430/MSP430.h
index 3fa024c..ed0cd04 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 c606112..71b785b 100644
--- a/lib/Target/MSP430/MSP430AsmPrinter.cpp
+++ b/lib/Target/MSP430/MSP430AsmPrinter.cpp
@@ -40,8 +40,9 @@
   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 @@
 ///
 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 91915d7..32e1f7a 100644
--- a/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp
+++ b/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp
@@ -41,8 +41,8 @@
     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 @@
 /// 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 155f8c2..7886946 100644
--- a/lib/Target/MSP430/MSP430TargetMachine.cpp
+++ b/lib/Target/MSP430/MSP430TargetMachine.cpp
@@ -47,17 +47,19 @@
   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 258a395..d9ffa2b 100644
--- a/lib/Target/MSP430/MSP430TargetMachine.h
+++ b/lib/Target/MSP430/MSP430TargetMachine.h
@@ -56,9 +56,10 @@
     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.