Introduce new headers whose inclusion forces linking and
[oota-llvm.git] / lib / Target / MSP430 / MSP430TargetMachine.cpp
index a2dee33c6c9e988357ebaa104f858f3e46815a51..0f5244d666fc75eefab1dee197ee64c054ce93d9 100644 (file)
@@ -35,29 +35,36 @@ int MSP430TargetMachineModule = 0;
 static RegisterTarget<MSP430TargetMachine>
 X("msp430", "MSP430 [experimental]");
 
+// Force static initialization when called from llvm/InitializeAllTargets.h
+namespace llvm {
+  void InitializeMSP430Target() { }
+}
+
 MSP430TargetMachine::MSP430TargetMachine(const Module &M,
                                          const std::string &FS) :
   Subtarget(*this, M, FS),
   // FIXME: Check TargetData string.
   DataLayout("e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"),
   InstrInfo(*this), TLInfo(*this),
-  FrameInfo(TargetFrameInfo::StackGrowsUp, 8, 0) { }
+  FrameInfo(TargetFrameInfo::StackGrowsDown, 2, -2) { }
 
 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;
 }