2008-11-07 18:59:00 +08:00
|
|
|
//===-- XCoreTargetMachine.cpp - Define TargetMachine for XCore -----------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "XCoreTargetMachine.h"
|
|
|
|
#include "XCore.h"
|
|
|
|
#include "llvm/Module.h"
|
|
|
|
#include "llvm/PassManager.h"
|
2009-08-15 20:53:15 +08:00
|
|
|
#include "llvm/Target/TargetRegistry.h"
|
2008-11-07 18:59:00 +08:00
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
/// XCoreTargetMachine ctor - Create an ILP32 architecture model
|
|
|
|
///
|
2009-08-03 07:37:13 +08:00
|
|
|
XCoreTargetMachine::XCoreTargetMachine(const Target &T, const std::string &TT,
|
2011-06-30 09:53:36 +08:00
|
|
|
const std::string &CPU,
|
2009-07-16 04:24:03 +08:00
|
|
|
const std::string &FS)
|
2011-07-08 09:53:10 +08:00
|
|
|
: LLVMTargetMachine(T, TT, CPU, FS),
|
2011-06-30 09:53:36 +08:00
|
|
|
Subtarget(TT, CPU, FS),
|
2008-11-07 18:59:00 +08:00
|
|
|
DataLayout("e-p:32:32:32-a0:0:32-f32:32:32-f64:32:32-i1:8:32-i8:8:32-"
|
2009-11-08 03:07:32 +08:00
|
|
|
"i16:16:32-i32:32:32-i64:32:32-n32"),
|
2008-11-07 18:59:00 +08:00
|
|
|
InstrInfo(),
|
2011-01-10 20:39:04 +08:00
|
|
|
FrameLowering(Subtarget),
|
2010-05-12 01:31:57 +08:00
|
|
|
TLInfo(*this),
|
|
|
|
TSInfo(*this) {
|
2008-11-07 18:59:00 +08:00
|
|
|
}
|
|
|
|
|
2009-04-29 08:15:41 +08:00
|
|
|
bool XCoreTargetMachine::addInstSelector(PassManagerBase &PM,
|
2009-04-30 07:29:43 +08:00
|
|
|
CodeGenOpt::Level OptLevel) {
|
2008-11-07 18:59:00 +08:00
|
|
|
PM.add(createXCoreISelDag(*this));
|
|
|
|
return false;
|
|
|
|
}
|
2009-08-15 20:53:15 +08:00
|
|
|
|
|
|
|
// Force static initialization.
|
|
|
|
extern "C" void LLVMInitializeXCoreTarget() {
|
|
|
|
RegisterTargetMachine<XCoreTargetMachine> X(TheXCoreTarget);
|
|
|
|
}
|