2008-11-07 10:59:00 +00: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 "XCoreTargetAsmInfo.h"
|
|
|
|
#include "XCoreTargetMachine.h"
|
|
|
|
#include "XCore.h"
|
|
|
|
#include "llvm/Module.h"
|
|
|
|
#include "llvm/PassManager.h"
|
|
|
|
#include "llvm/Target/TargetMachineRegistry.h"
|
|
|
|
using namespace llvm;
|
|
|
|
|
2009-07-15 20:24:03 +00:00
|
|
|
extern Target TheXCoreTarget;
|
2008-11-07 10:59:00 +00:00
|
|
|
namespace {
|
|
|
|
// Register the target.
|
2009-07-15 20:24:03 +00:00
|
|
|
RegisterTarget<XCoreTargetMachine> X(TheXCoreTarget, "xcore", "XCore");
|
2008-11-07 10:59:00 +00:00
|
|
|
}
|
|
|
|
|
2009-06-23 23:59:40 +00:00
|
|
|
// Force static initialization.
|
2009-07-15 23:17:20 +00:00
|
|
|
extern "C" void LLVMInitializeXCoreTarget() {
|
|
|
|
TargetRegistry::RegisterAsmPrinter(TheXCoreTarget,
|
|
|
|
&createXCoreCodePrinterPass);
|
|
|
|
}
|
2009-06-16 20:12:29 +00:00
|
|
|
|
2008-11-07 10:59:00 +00:00
|
|
|
const TargetAsmInfo *XCoreTargetMachine::createTargetAsmInfo() const {
|
|
|
|
return new XCoreTargetAsmInfo(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// XCoreTargetMachine ctor - Create an ILP32 architecture model
|
|
|
|
///
|
2009-07-15 20:24:03 +00:00
|
|
|
XCoreTargetMachine::XCoreTargetMachine(const Target &T, const Module &M,
|
|
|
|
const std::string &FS)
|
|
|
|
: LLVMTargetMachine(T),
|
|
|
|
Subtarget(*this, M, FS),
|
2008-11-07 10:59:00 +00:00
|
|
|
DataLayout("e-p:32:32:32-a0:0:32-f32:32:32-f64:32:32-i1:8:32-i8:8:32-"
|
|
|
|
"i16:16:32-i32:32:32-i64:32:32"),
|
|
|
|
InstrInfo(),
|
|
|
|
FrameInfo(*this),
|
|
|
|
TLInfo(*this) {
|
|
|
|
}
|
|
|
|
|
2009-04-29 00:15:41 +00:00
|
|
|
bool XCoreTargetMachine::addInstSelector(PassManagerBase &PM,
|
2009-04-29 23:29:43 +00:00
|
|
|
CodeGenOpt::Level OptLevel) {
|
2008-11-07 10:59:00 +00:00
|
|
|
PM.add(createXCoreISelDag(*this));
|
|
|
|
return false;
|
|
|
|
}
|