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 "XCoreFrameLowering.h"
18 #include "XCoreISelLowering.h"
19 #include "XCoreInstrInfo.h"
20 #include "XCoreSelectionDAGInfo.h"
21 #include "XCoreSubtarget.h"
22 #include "llvm/IR/DataLayout.h"
23 #include "llvm/Target/TargetMachine.h"
27 class XCoreTargetMachine : public LLVMTargetMachine {
28 XCoreSubtarget Subtarget;
29 const DataLayout DL; // 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, const TargetOptions &Options,
37 Reloc::Model RM, CodeModel::Model CM,
38 CodeGenOpt::Level OL);
40 const XCoreInstrInfo *getInstrInfo() const override { return &InstrInfo; }
41 const XCoreFrameLowering *getFrameLowering() const override {
42 return &FrameLowering;
44 const XCoreSubtarget *getSubtargetImpl() const override { return &Subtarget; }
45 const XCoreTargetLowering *getTargetLowering() const override {
49 const XCoreSelectionDAGInfo* getSelectionDAGInfo() const override {
53 const TargetRegisterInfo *getRegisterInfo() const override {
54 return &InstrInfo.getRegisterInfo();
56 const DataLayout *getDataLayout() const override { return &DL; }
58 // Pass Pipeline Configuration
59 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
61 void addAnalysisPasses(PassManagerBase &PM) override;
64 } // end namespace llvm