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.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2009-08-22 20:48:53 +00:00
|
|
|
#include "XCoreMCAsmInfo.h"
|
2008-11-07 10:59:00 +00:00
|
|
|
#include "XCoreTargetMachine.h"
|
|
|
|
#include "XCore.h"
|
|
|
|
#include "llvm/Module.h"
|
|
|
|
#include "llvm/PassManager.h"
|
2009-08-15 12:53:15 +00:00
|
|
|
#include "llvm/Target/TargetRegistry.h"
|
2008-11-07 10:59:00 +00:00
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
/// XCoreTargetMachine ctor - Create an ILP32 architecture model
|
|
|
|
///
|
2009-08-02 23:37:13 +00:00
|
|
|
XCoreTargetMachine::XCoreTargetMachine(const Target &T, const std::string &TT,
|
2009-07-15 20:24:03 +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),
|
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-"
|
2009-11-07 19:07:32 +00:00
|
|
|
"i16:16:32-i32:32:32-i64:32:32-n32"),
|
2008-11-07 10:59:00 +00:00
|
|
|
InstrInfo(),
|
2011-01-10 12:39:04 +00:00
|
|
|
FrameLowering(Subtarget),
|
2010-05-11 17:31:57 +00:00
|
|
|
TLInfo(*this),
|
|
|
|
TSInfo(*this) {
|
2008-11-07 10:59:00 +00:00
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
}
|
2009-08-15 12:53:15 +00:00
|
|
|
|
|
|
|
// Force static initialization.
|
|
|
|
extern "C" void LLVMInitializeXCoreTarget() {
|
|
|
|
RegisterTargetMachine<XCoreTargetMachine> X(TheXCoreTarget);
|
2009-08-22 20:48:53 +00:00
|
|
|
RegisterAsmInfo<XCoreMCAsmInfo> Y(TheXCoreTarget);
|
2009-08-15 12:53:15 +00:00
|
|
|
}
|