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 "XCoreTargetMachine.h"
|
|
|
|
#include "XCore.h"
|
|
|
|
#include "llvm/Module.h"
|
|
|
|
#include "llvm/PassManager.h"
|
2011-08-24 18:08:43 +00:00
|
|
|
#include "llvm/Support/TargetRegistry.h"
|
2008-11-07 10:59:00 +00:00
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
/// XCoreTargetMachine ctor - Create an ILP32 architecture model
|
|
|
|
///
|
2011-07-19 06:37:02 +00:00
|
|
|
XCoreTargetMachine::XCoreTargetMachine(const Target &T, StringRef TT,
|
2011-07-20 07:51:56 +00:00
|
|
|
StringRef CPU, StringRef FS,
|
|
|
|
Reloc::Model RM, CodeModel::Model CM)
|
|
|
|
: LLVMTargetMachine(T, TT, CPU, FS, RM, CM),
|
2011-06-30 01:53:36 +00:00
|
|
|
Subtarget(TT, CPU, 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);
|
|
|
|
}
|