LLVM API Documentation
00001 //===-- XCoreTargetMachine.h - Define TargetMachine for XCore ---*- C++ -*-===// 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 // This file declares the XCore specific subclass of TargetMachine. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #ifndef XCORETARGETMACHINE_H 00015 #define XCORETARGETMACHINE_H 00016 00017 #include "llvm/Target/TargetMachine.h" 00018 #include "llvm/Target/TargetData.h" 00019 #include "XCoreFrameInfo.h" 00020 #include "XCoreSubtarget.h" 00021 #include "XCoreInstrInfo.h" 00022 #include "XCoreISelLowering.h" 00023 00024 namespace llvm { 00025 00026 class XCoreTargetMachine : public LLVMTargetMachine { 00027 XCoreSubtarget Subtarget; 00028 const TargetData DataLayout; // Calculates type size & alignment 00029 XCoreInstrInfo InstrInfo; 00030 XCoreFrameInfo FrameInfo; 00031 XCoreTargetLowering TLInfo; 00032 public: 00033 XCoreTargetMachine(const Target &T, const std::string &TT, 00034 const std::string &FS); 00035 00036 virtual const XCoreInstrInfo *getInstrInfo() const { return &InstrInfo; } 00037 virtual const XCoreFrameInfo *getFrameInfo() const { return &FrameInfo; } 00038 virtual const XCoreSubtarget *getSubtargetImpl() const { return &Subtarget; } 00039 virtual XCoreTargetLowering *getTargetLowering() const { 00040 return const_cast<XCoreTargetLowering*>(&TLInfo); 00041 } 00042 00043 virtual const TargetRegisterInfo *getRegisterInfo() const { 00044 return &InstrInfo.getRegisterInfo(); 00045 } 00046 virtual const TargetData *getTargetData() const { return &DataLayout; } 00047 00048 // Pass Pipeline Configuration 00049 virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel); 00050 }; 00051 00052 } // end namespace llvm 00053 00054 #endif