Move all of the header files which are involved in modelling the LLVM IR
[oota-llvm.git] / lib / Target / Hexagon / HexagonTargetMachine.h
1 //=-- HexagonTargetMachine.h - Define TargetMachine for Hexagon ---*- 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 Hexagon specific subclass of TargetMachine.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef HexagonTARGETMACHINE_H
15 #define HexagonTARGETMACHINE_H
16
17 #include "HexagonFrameLowering.h"
18 #include "HexagonISelLowering.h"
19 #include "HexagonInstrInfo.h"
20 #include "HexagonSelectionDAGInfo.h"
21 #include "HexagonSubtarget.h"
22 #include "llvm/IR/DataLayout.h"
23 #include "llvm/Target/TargetMachine.h"
24 #include "llvm/Target/TargetTransformImpl.h"
25
26 namespace llvm {
27
28 class Module;
29
30 class HexagonTargetMachine : public LLVMTargetMachine {
31   const DataLayout DL;       // Calculates type size & alignment.
32   HexagonSubtarget Subtarget;
33   HexagonInstrInfo InstrInfo;
34   HexagonTargetLowering TLInfo;
35   HexagonSelectionDAGInfo TSInfo;
36   HexagonFrameLowering FrameLowering;
37   const InstrItineraryData* InstrItins;
38   ScalarTargetTransformImpl STTI;
39   VectorTargetTransformImpl VTTI;
40
41 public:
42   HexagonTargetMachine(const Target &T, StringRef TT,StringRef CPU,
43                        StringRef FS, const TargetOptions &Options,
44                        Reloc::Model RM, CodeModel::Model CM,
45                        CodeGenOpt::Level OL);
46
47   virtual const HexagonInstrInfo *getInstrInfo() const {
48     return &InstrInfo;
49   }
50   virtual const HexagonSubtarget *getSubtargetImpl() const {
51     return &Subtarget;
52   }
53   virtual const HexagonRegisterInfo *getRegisterInfo() const {
54     return &InstrInfo.getRegisterInfo();
55   }
56
57   virtual const InstrItineraryData* getInstrItineraryData() const {
58     return InstrItins;
59   }
60
61
62   virtual const HexagonTargetLowering* getTargetLowering() const {
63     return &TLInfo;
64   }
65
66   virtual const HexagonFrameLowering* getFrameLowering() const {
67     return &FrameLowering;
68   }
69
70   virtual const HexagonSelectionDAGInfo* getSelectionDAGInfo() const {
71     return &TSInfo;
72   }
73
74   virtual const ScalarTargetTransformInfo *getScalarTargetTransformInfo()const {
75     return &STTI;
76   }
77
78   virtual const VectorTargetTransformInfo *getVectorTargetTransformInfo()const {
79     return &VTTI;
80   }
81
82   virtual const DataLayout       *getDataLayout() const { return &DL; }
83   static unsigned getModuleMatchQuality(const Module &M);
84
85   // Pass Pipeline Configuration.
86   virtual bool addPassesForOptimizations(PassManagerBase &PM);
87   virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
88 };
89
90 extern bool flag_aligned_memcpy;
91
92 } // end namespace llvm
93
94 #endif