1 //===-- MSP430TargetMachine.cpp - Define TargetMachine for MSP430 ---------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Top-level implementation for the MSP430 target.
12 //===----------------------------------------------------------------------===//
15 #include "MSP430TargetAsmInfo.h"
16 #include "MSP430TargetMachine.h"
17 #include "llvm/PassManager.h"
18 #include "llvm/CodeGen/Passes.h"
19 #include "llvm/Target/TargetAsmInfo.h"
22 MSP430TargetMachine::MSP430TargetMachine(const Target &T,
23 const std::string &TT,
24 const std::string &FS) :
25 LLVMTargetMachine(T, TT),
27 // FIXME: Check TargetData string.
28 DataLayout("e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"),
29 InstrInfo(*this), TLInfo(*this),
30 FrameInfo(TargetFrameInfo::StackGrowsDown, 2, -2) { }
32 const TargetAsmInfo *MSP430TargetMachine::createTargetAsmInfo() const {
33 return new MSP430TargetAsmInfo();
36 bool MSP430TargetMachine::addInstSelector(PassManagerBase &PM,
37 CodeGenOpt::Level OptLevel) {
38 // Install an instruction selector.
39 PM.add(createMSP430ISelDag(*this, OptLevel));