1 //===-- XCoreTargetMachine.h - Define TargetMachine for XCore ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the XCore specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef XCORETARGETMACHINE_H
15 #define XCORETARGETMACHINE_H
17 #include "llvm/Target/TargetMachine.h"
18 #include "llvm/Target/TargetData.h"
19 #include "XCoreFrameLowering.h"
20 #include "XCoreSubtarget.h"
21 #include "XCoreInstrInfo.h"
22 #include "XCoreISelLowering.h"
23 #include "XCoreSelectionDAGInfo.h"
27 class XCoreTargetMachine : public LLVMTargetMachine {
28 XCoreSubtarget Subtarget;
29 const TargetData DataLayout; // Calculates type size & alignment
30 XCoreInstrInfo InstrInfo;
31 XCoreFrameLowering FrameLowering;
32 XCoreTargetLowering TLInfo;
33 XCoreSelectionDAGInfo TSInfo;
35 XCoreTargetMachine(const Target &T, StringRef TT,
36 StringRef CPU, StringRef FS,
37 Reloc::Model RM, CodeModel::Model CM);
39 virtual const XCoreInstrInfo *getInstrInfo() const { return &InstrInfo; }
40 virtual const XCoreFrameLowering *getFrameLowering() const {
41 return &FrameLowering;
43 virtual const XCoreSubtarget *getSubtargetImpl() const { return &Subtarget; }
44 virtual const XCoreTargetLowering *getTargetLowering() const {
48 virtual const XCoreSelectionDAGInfo* getSelectionDAGInfo() const {
52 virtual const TargetRegisterInfo *getRegisterInfo() const {
53 return &InstrInfo.getRegisterInfo();
55 virtual const TargetData *getTargetData() const { return &DataLayout; }
57 // Pass Pipeline Configuration
58 virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
61 } // end namespace llvm