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"
24 #include "llvm/Target/TargetTransformImpl.h"
28 class XCoreTargetMachine : public LLVMTargetMachine {
29 XCoreSubtarget Subtarget;
30 const DataLayout DL; // Calculates type size & alignment
31 XCoreInstrInfo InstrInfo;
32 XCoreFrameLowering FrameLowering;
33 XCoreTargetLowering TLInfo;
34 XCoreSelectionDAGInfo TSInfo;
35 ScalarTargetTransformImpl STTI;
36 VectorTargetTransformImpl VTTI;
38 XCoreTargetMachine(const Target &T, StringRef TT,
39 StringRef CPU, StringRef FS, const TargetOptions &Options,
40 Reloc::Model RM, CodeModel::Model CM,
41 CodeGenOpt::Level OL);
43 virtual const XCoreInstrInfo *getInstrInfo() const { return &InstrInfo; }
44 virtual const XCoreFrameLowering *getFrameLowering() const {
45 return &FrameLowering;
47 virtual const XCoreSubtarget *getSubtargetImpl() const { return &Subtarget; }
48 virtual const XCoreTargetLowering *getTargetLowering() const {
52 virtual const XCoreSelectionDAGInfo* getSelectionDAGInfo() const {
56 virtual const TargetRegisterInfo *getRegisterInfo() const {
57 return &InstrInfo.getRegisterInfo();
59 virtual const ScalarTargetTransformInfo *getScalarTargetTransformInfo()const {
62 virtual const VectorTargetTransformInfo *getVectorTargetTransformInfo()const {
65 virtual const DataLayout *getDataLayout() const { return &DL; }
67 // Pass Pipeline Configuration
68 virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
71 } // end namespace llvm