2009-05-03 12:57:15 +00:00
|
|
|
//===-- MSP430TargetMachine.cpp - Define TargetMachine for MSP430 ---------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// Top-level implementation for the MSP430 target.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "MSP430.h"
|
|
|
|
#include "MSP430TargetAsmInfo.h"
|
|
|
|
#include "MSP430TargetMachine.h"
|
|
|
|
#include "llvm/PassManager.h"
|
|
|
|
#include "llvm/CodeGen/Passes.h"
|
|
|
|
#include "llvm/Target/TargetAsmInfo.h"
|
|
|
|
using namespace llvm;
|
|
|
|
|
2009-07-15 20:24:03 +00:00
|
|
|
MSP430TargetMachine::MSP430TargetMachine(const Target &T,
|
2009-08-02 23:37:13 +00:00
|
|
|
const std::string &TT,
|
2009-05-03 12:57:15 +00:00
|
|
|
const std::string &FS) :
|
2009-08-11 20:42:37 +00:00
|
|
|
LLVMTargetMachine(T, TT),
|
2009-08-02 23:37:13 +00:00
|
|
|
Subtarget(TT, FS),
|
2009-05-03 12:58:05 +00:00
|
|
|
// FIXME: Check TargetData string.
|
2009-05-03 12:57:15 +00:00
|
|
|
DataLayout("e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"),
|
|
|
|
InstrInfo(*this), TLInfo(*this),
|
2009-05-03 13:11:20 +00:00
|
|
|
FrameInfo(TargetFrameInfo::StackGrowsDown, 2, -2) { }
|
2009-05-03 12:57:15 +00:00
|
|
|
|
|
|
|
|
2009-05-03 13:19:42 +00:00
|
|
|
bool MSP430TargetMachine::addInstSelector(PassManagerBase &PM,
|
|
|
|
CodeGenOpt::Level OptLevel) {
|
2009-05-03 12:57:15 +00:00
|
|
|
// Install an instruction selector.
|
2009-05-03 13:19:42 +00:00
|
|
|
PM.add(createMSP430ISelDag(*this, OptLevel));
|
2009-05-03 12:57:15 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|