1 //===-- XCoreTargetMachine.cpp - Define TargetMachine for XCore -----------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // 11 //===----------------------------------------------------------------------===// 12 13 #include "XCoreTargetMachine.h" 14 #include "XCore.h" 15 #include "llvm/Module.h" 16 #include "llvm/PassManager.h" 17 #include "llvm/Support/TargetRegistry.h" 18 using namespace llvm; 19 20 /// XCoreTargetMachine ctor - Create an ILP32 architecture model 21 /// 22 XCoreTargetMachine::XCoreTargetMachine(const Target &T, StringRef TT, 23 StringRef CPU, StringRef FS, 24 const TargetOptions &Options, 25 Reloc::Model RM, CodeModel::Model CM, 26 CodeGenOpt::Level OL) 27 : LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL), 28 Subtarget(TT, CPU, FS), 29 DataLayout("e-p:32:32:32-a0:0:32-f32:32:32-f64:32:32-i1:8:32-i8:8:32-" 30 "i16:16:32-i32:32:32-i64:32:32-n32"), 31 InstrInfo(), 32 FrameLowering(Subtarget), 33 TLInfo(*this), 34 TSInfo(*this) { 35 } 36 37 bool XCoreTargetMachine::addInstSelector(PassManagerBase &PM) { 38 PM.add(createXCoreISelDag(*this)); 39 return false; 40 } 41 42 // Force static initialization. 43 extern "C" void LLVMInitializeXCoreTarget() { 44 RegisterTargetMachine<XCoreTargetMachine> X(TheXCoreTarget); 45 } 46