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 "XCoreTargetAsmInfo.h" 14 #include "XCoreTargetMachine.h" 15 #include "XCore.h" 16 #include "llvm/Module.h" 17 #include "llvm/PassManager.h" 18 using namespace llvm; 19 20 const TargetAsmInfo *XCoreTargetMachine::createTargetAsmInfo() const { 21 return new XCoreTargetAsmInfo(); 22 } 23 24 /// XCoreTargetMachine ctor - Create an ILP32 architecture model 25 /// 26 XCoreTargetMachine::XCoreTargetMachine(const Target &T, const std::string &TT, 27 const std::string &FS) 28 : LLVMTargetMachine(T), 29 Subtarget(TT, FS), 30 DataLayout("e-p:32:32:32-a0:0:32-f32:32:32-f64:32:32-i1:8:32-i8:8:32-" 31 "i16:16:32-i32:32:32-i64:32:32"), 32 InstrInfo(), 33 FrameInfo(*this), 34 TLInfo(*this) { 35 } 36 37 bool XCoreTargetMachine::addInstSelector(PassManagerBase &PM, 38 CodeGenOpt::Level OptLevel) { 39 PM.add(createXCoreISelDag(*this)); 40 return false; 41 } 42