Move all of the header files which are involved in modelling the LLVM IR
[oota-llvm.git] / lib / Target / MBlaze / MBlazeTargetMachine.h
1 //===-- MBlazeTargetMachine.h - Define TargetMachine for MBlaze -*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares the MBlaze specific subclass of TargetMachine.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef MBLAZE_TARGETMACHINE_H
15 #define MBLAZE_TARGETMACHINE_H
16
17 #include "MBlazeFrameLowering.h"
18 #include "MBlazeISelLowering.h"
19 #include "MBlazeInstrInfo.h"
20 #include "MBlazeIntrinsicInfo.h"
21 #include "MBlazeSelectionDAGInfo.h"
22 #include "MBlazeSubtarget.h"
23 #include "llvm/IR/DataLayout.h"
24 #include "llvm/MC/MCStreamer.h"
25 #include "llvm/Target/TargetFrameLowering.h"
26 #include "llvm/Target/TargetMachine.h"
27 #include "llvm/Target/TargetTransformImpl.h"
28
29 namespace llvm {
30   class formatted_raw_ostream;
31
32   class MBlazeTargetMachine : public LLVMTargetMachine {
33     MBlazeSubtarget        Subtarget;
34     const DataLayout       DL; // Calculates type size & alignment
35     MBlazeInstrInfo        InstrInfo;
36     MBlazeFrameLowering    FrameLowering;
37     MBlazeTargetLowering   TLInfo;
38     MBlazeSelectionDAGInfo TSInfo;
39     MBlazeIntrinsicInfo    IntrinsicInfo;
40     InstrItineraryData     InstrItins;
41     ScalarTargetTransformImpl STTI;
42     VectorTargetTransformImpl VTTI;
43
44   public:
45     MBlazeTargetMachine(const Target &T, StringRef TT,
46                         StringRef CPU, StringRef FS,
47                         const TargetOptions &Options,
48                         Reloc::Model RM, CodeModel::Model CM,
49                         CodeGenOpt::Level OL);
50
51     virtual const MBlazeInstrInfo *getInstrInfo() const
52     { return &InstrInfo; }
53
54     virtual const InstrItineraryData *getInstrItineraryData() const
55     {  return &InstrItins; }
56
57     virtual const TargetFrameLowering *getFrameLowering() const
58     { return &FrameLowering; }
59
60     virtual const MBlazeSubtarget *getSubtargetImpl() const
61     { return &Subtarget; }
62
63     virtual const DataLayout *getDataLayout() const
64     { return &DL;}
65
66     virtual const MBlazeRegisterInfo *getRegisterInfo() const
67     { return &InstrInfo.getRegisterInfo(); }
68
69     virtual const MBlazeTargetLowering *getTargetLowering() const
70     { return &TLInfo; }
71
72     virtual const MBlazeSelectionDAGInfo* getSelectionDAGInfo() const
73     { return &TSInfo; }
74
75     const TargetIntrinsicInfo *getIntrinsicInfo() const
76     { return &IntrinsicInfo; }
77
78     virtual const ScalarTargetTransformInfo *getScalarTargetTransformInfo()const
79     { return &STTI; }
80     virtual const VectorTargetTransformInfo *getVectorTargetTransformInfo()const
81     { return &VTTI; }
82
83     // Pass Pipeline Configuration
84     virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
85   };
86 } // End llvm namespace
87
88 #endif