Sort includes for all of the .h files under the 'lib' tree. These were
[oota-llvm.git] / lib / Target / Sparc / SparcTargetMachine.h
1 //===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- 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 Sparc specific subclass of TargetMachine.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef SPARCTARGETMACHINE_H
15 #define SPARCTARGETMACHINE_H
16
17 #include "SparcFrameLowering.h"
18 #include "SparcISelLowering.h"
19 #include "SparcInstrInfo.h"
20 #include "SparcSelectionDAGInfo.h"
21 #include "SparcSubtarget.h"
22 #include "llvm/DataLayout.h"
23 #include "llvm/Target/TargetFrameLowering.h"
24 #include "llvm/Target/TargetMachine.h"
25 #include "llvm/Target/TargetTransformImpl.h"
26
27 namespace llvm {
28
29 class SparcTargetMachine : public LLVMTargetMachine {
30   SparcSubtarget Subtarget;
31   const DataLayout DL;       // Calculates type size & alignment
32   SparcInstrInfo InstrInfo;
33   SparcTargetLowering TLInfo;
34   SparcSelectionDAGInfo TSInfo;
35   SparcFrameLowering FrameLowering;
36   ScalarTargetTransformImpl STTI;
37   VectorTargetTransformImpl VTTI;
38 public:
39   SparcTargetMachine(const Target &T, StringRef TT,
40                      StringRef CPU, StringRef FS, const TargetOptions &Options,
41                      Reloc::Model RM, CodeModel::Model CM,
42                      CodeGenOpt::Level OL, bool is64bit);
43
44   virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
45   virtual const TargetFrameLowering  *getFrameLowering() const {
46     return &FrameLowering;
47   }
48   virtual const SparcSubtarget   *getSubtargetImpl() const{ return &Subtarget; }
49   virtual const SparcRegisterInfo *getRegisterInfo() const {
50     return &InstrInfo.getRegisterInfo();
51   }
52   virtual const SparcTargetLowering* getTargetLowering() const {
53     return &TLInfo;
54   }
55   virtual const SparcSelectionDAGInfo* getSelectionDAGInfo() const {
56     return &TSInfo;
57   }
58   virtual const ScalarTargetTransformInfo *getScalarTargetTransformInfo()const {
59     return &STTI;
60   }
61   virtual const VectorTargetTransformInfo *getVectorTargetTransformInfo()const {
62     return &VTTI;
63   }
64   virtual const DataLayout       *getDataLayout() const { return &DL; }
65
66   // Pass Pipeline Configuration
67   virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
68 };
69
70 /// SparcV8TargetMachine - Sparc 32-bit target machine
71 ///
72 class SparcV8TargetMachine : public SparcTargetMachine {
73   virtual void anchor();
74 public:
75   SparcV8TargetMachine(const Target &T, StringRef TT,
76                        StringRef CPU, StringRef FS,
77                        const TargetOptions &Options,
78                        Reloc::Model RM, CodeModel::Model CM,
79                        CodeGenOpt::Level OL);
80 };
81
82 /// SparcV9TargetMachine - Sparc 64-bit target machine
83 ///
84 class SparcV9TargetMachine : public SparcTargetMachine {
85   virtual void anchor();
86 public:
87   SparcV9TargetMachine(const Target &T, StringRef TT,
88                        StringRef CPU, StringRef FS,
89                        const TargetOptions &Options,
90                        Reloc::Model RM, CodeModel::Model CM,
91                        CodeGenOpt::Level OL);
92 };
93
94 } // end namespace llvm
95
96 #endif