LLVM API Documentation
00001 //===-- XCoreTargetMachine.cpp - Define TargetMachine for XCore -----------===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // 00011 //===----------------------------------------------------------------------===// 00012 00013 #include "XCoreTargetAsmInfo.h" 00014 #include "XCoreTargetMachine.h" 00015 #include "XCore.h" 00016 #include "llvm/Module.h" 00017 #include "llvm/PassManager.h" 00018 #include "llvm/Target/TargetRegistry.h" 00019 using namespace llvm; 00020 00021 /// XCoreTargetMachine ctor - Create an ILP32 architecture model 00022 /// 00023 XCoreTargetMachine::XCoreTargetMachine(const Target &T, const std::string &TT, 00024 const std::string &FS) 00025 : LLVMTargetMachine(T, TT), 00026 Subtarget(TT, FS), 00027 DataLayout("e-p:32:32:32-a0:0:32-f32:32:32-f64:32:32-i1:8:32-i8:8:32-" 00028 "i16:16:32-i32:32:32-i64:32:32"), 00029 InstrInfo(), 00030 FrameInfo(*this), 00031 TLInfo(*this) { 00032 } 00033 00034 bool XCoreTargetMachine::addInstSelector(PassManagerBase &PM, 00035 CodeGenOpt::Level OptLevel) { 00036 PM.add(createXCoreISelDag(*this)); 00037 return false; 00038 } 00039 00040 // Force static initialization. 00041 extern "C" void LLVMInitializeXCoreTarget() { 00042 RegisterTargetMachine<XCoreTargetMachine> X(TheXCoreTarget); 00043 RegisterAsmInfo<XCoreTargetAsmInfo> Y(TheXCoreTarget); 00044 }