comparison lib/Target/Mips/MipsTargetMachine.h @ 121:803732b1fca8

LLVM 5.0
author kono
date Fri, 27 Oct 2017 17:07:41 +0900
parents 1172e4bd9c6f
children 3a76565eade5
comparison
equal deleted inserted replaced
120:1172e4bd9c6f 121:803732b1fca8
1 //===-- MipsTargetMachine.h - Define TargetMachine for Mips -----*- C++ -*-===// 1 //===- MipsTargetMachine.h - Define TargetMachine for Mips ------*- C++ -*-===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
14 #ifndef LLVM_LIB_TARGET_MIPS_MIPSTARGETMACHINE_H 14 #ifndef LLVM_LIB_TARGET_MIPS_MIPSTARGETMACHINE_H
15 #define LLVM_LIB_TARGET_MIPS_MIPSTARGETMACHINE_H 15 #define LLVM_LIB_TARGET_MIPS_MIPSTARGETMACHINE_H
16 16
17 #include "MCTargetDesc/MipsABIInfo.h" 17 #include "MCTargetDesc/MipsABIInfo.h"
18 #include "MipsSubtarget.h" 18 #include "MipsSubtarget.h"
19 #include "llvm/CodeGen/BasicTTIImpl.h" 19 #include "llvm/ADT/Optional.h"
20 #include "llvm/CodeGen/Passes.h" 20 #include "llvm/ADT/StringMap.h"
21 #include "llvm/CodeGen/SelectionDAGISel.h" 21 #include "llvm/ADT/StringRef.h"
22 #include "llvm/Target/TargetFrameLowering.h" 22 #include "llvm/Support/CodeGen.h"
23 #include "llvm/Target/TargetMachine.h" 23 #include "llvm/Target/TargetMachine.h"
24 #include <memory>
24 25
25 namespace llvm { 26 namespace llvm {
26 class formatted_raw_ostream;
27 class MipsRegisterInfo;
28 27
29 class MipsTargetMachine : public LLVMTargetMachine { 28 class MipsTargetMachine : public LLVMTargetMachine {
30 bool isLittle; 29 bool isLittle;
31 std::unique_ptr<TargetLoweringObjectFile> TLOF; 30 std::unique_ptr<TargetLoweringObjectFile> TLOF;
32 // Selected ABI 31 // Selected ABI
39 mutable StringMap<std::unique_ptr<MipsSubtarget>> SubtargetMap; 38 mutable StringMap<std::unique_ptr<MipsSubtarget>> SubtargetMap;
40 39
41 public: 40 public:
42 MipsTargetMachine(const Target &T, const Triple &TT, StringRef CPU, 41 MipsTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
43 StringRef FS, const TargetOptions &Options, 42 StringRef FS, const TargetOptions &Options,
44 Optional<Reloc::Model> RM, CodeModel::Model CM, 43 Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
45 CodeGenOpt::Level OL, bool isLittle); 44 CodeGenOpt::Level OL, bool JIT, bool isLittle);
46 ~MipsTargetMachine() override; 45 ~MipsTargetMachine() override;
47 46
48 TargetIRAnalysis getTargetIRAnalysis() override; 47 TargetIRAnalysis getTargetIRAnalysis() override;
49 48
50 const MipsSubtarget *getSubtargetImpl() const { 49 const MipsSubtarget *getSubtargetImpl() const {
65 return TLOF.get(); 64 return TLOF.get();
66 } 65 }
67 66
68 bool isLittleEndian() const { return isLittle; } 67 bool isLittleEndian() const { return isLittle; }
69 const MipsABIInfo &getABI() const { return ABI; } 68 const MipsABIInfo &getABI() const { return ABI; }
69
70 bool isMachineVerifierClean() const override {
71 return false;
72 }
70 }; 73 };
71 74
72 /// Mips32/64 big endian target machine. 75 /// Mips32/64 big endian target machine.
73 /// 76 ///
74 class MipsebTargetMachine : public MipsTargetMachine { 77 class MipsebTargetMachine : public MipsTargetMachine {
75 virtual void anchor(); 78 virtual void anchor();
79
76 public: 80 public:
77 MipsebTargetMachine(const Target &T, const Triple &TT, StringRef CPU, 81 MipsebTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
78 StringRef FS, const TargetOptions &Options, 82 StringRef FS, const TargetOptions &Options,
79 Optional<Reloc::Model> RM, CodeModel::Model CM, 83 Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
80 CodeGenOpt::Level OL); 84 CodeGenOpt::Level OL, bool JIT);
81 }; 85 };
82 86
83 /// Mips32/64 little endian target machine. 87 /// Mips32/64 little endian target machine.
84 /// 88 ///
85 class MipselTargetMachine : public MipsTargetMachine { 89 class MipselTargetMachine : public MipsTargetMachine {
86 virtual void anchor(); 90 virtual void anchor();
91
87 public: 92 public:
88 MipselTargetMachine(const Target &T, const Triple &TT, StringRef CPU, 93 MipselTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
89 StringRef FS, const TargetOptions &Options, 94 StringRef FS, const TargetOptions &Options,
90 Optional<Reloc::Model> RM, CodeModel::Model CM, 95 Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
91 CodeGenOpt::Level OL); 96 CodeGenOpt::Level OL, bool JIT);
92 }; 97 };
93 98
94 } // End llvm namespace 99 } // end namespace llvm
95 100
96 #endif 101 #endif // LLVM_LIB_TARGET_MIPS_MIPSTARGETMACHINE_H