1 //===-- ARMTargetMachine.h - Define TargetMachine for ARM -------*- 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 ARM specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef ARMTARGETMACHINE_H
15 #define ARMTARGETMACHINE_H
17 #include "ARMInstrInfo.h"
18 #include "ARMSubtarget.h"
19 #include "llvm/IR/DataLayout.h"
20 #include "llvm/Target/TargetMachine.h"
24 class ARMBaseTargetMachine : public LLVMTargetMachine {
26 ARMSubtarget Subtarget;
28 ARMBaseTargetMachine(const Target &T, StringRef TT,
29 StringRef CPU, StringRef FS,
30 const TargetOptions &Options,
31 Reloc::Model RM, CodeModel::Model CM,
35 const ARMSubtarget *getSubtargetImpl() const override { return &Subtarget; }
36 const ARMBaseRegisterInfo *getRegisterInfo() const override {
37 return getSubtargetImpl()->getRegisterInfo();
39 const ARMTargetLowering *getTargetLowering() const override {
40 return getSubtargetImpl()->getTargetLowering();
42 const ARMSelectionDAGInfo *getSelectionDAGInfo() const override {
43 return getSubtargetImpl()->getSelectionDAGInfo();
45 const ARMBaseInstrInfo *getInstrInfo() const override {
46 return getSubtargetImpl()->getInstrInfo();
48 const ARMFrameLowering *getFrameLowering() const override {
49 return getSubtargetImpl()->getFrameLowering();
51 const InstrItineraryData *getInstrItineraryData() const override {
52 return &getSubtargetImpl()->getInstrItineraryData();
54 const DataLayout *getDataLayout() const override {
55 return getSubtargetImpl()->getDataLayout();
57 ARMJITInfo *getJITInfo() override { return Subtarget.getJITInfo(); }
59 /// \brief Register ARM analysis passes with a pass manager.
60 void addAnalysisPasses(PassManagerBase &PM) override;
62 // Pass Pipeline Configuration
63 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
65 bool addCodeEmitter(PassManagerBase &PM, JITCodeEmitter &MCE) override;
68 /// ARMTargetMachine - ARM target machine.
70 class ARMTargetMachine : public ARMBaseTargetMachine {
71 virtual void anchor();
73 ARMTargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS,
74 const TargetOptions &Options, Reloc::Model RM,
75 CodeModel::Model CM, CodeGenOpt::Level OL, bool isLittle);
78 /// ARMLETargetMachine - ARM little endian target machine.
80 class ARMLETargetMachine : public ARMTargetMachine {
81 void anchor() override;
83 ARMLETargetMachine(const Target &T, StringRef TT,
84 StringRef CPU, StringRef FS, const TargetOptions &Options,
85 Reloc::Model RM, CodeModel::Model CM,
86 CodeGenOpt::Level OL);
89 /// ARMBETargetMachine - ARM big endian target machine.
91 class ARMBETargetMachine : public ARMTargetMachine {
92 void anchor() override;
94 ARMBETargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS,
95 const TargetOptions &Options, Reloc::Model RM,
96 CodeModel::Model CM, CodeGenOpt::Level OL);
99 /// ThumbTargetMachine - Thumb target machine.
100 /// Due to the way architectures are handled, this represents both
101 /// Thumb-1 and Thumb-2.
103 class ThumbTargetMachine : public ARMBaseTargetMachine {
104 virtual void anchor();
106 ThumbTargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS,
107 const TargetOptions &Options, Reloc::Model RM,
108 CodeModel::Model CM, CodeGenOpt::Level OL, bool isLittle);
111 /// ThumbLETargetMachine - Thumb little endian target machine.
113 class ThumbLETargetMachine : public ThumbTargetMachine {
114 void anchor() override;
116 ThumbLETargetMachine(const Target &T, StringRef TT, StringRef CPU,
117 StringRef FS, const TargetOptions &Options,
118 Reloc::Model RM, CodeModel::Model CM,
119 CodeGenOpt::Level OL);
122 /// ThumbBETargetMachine - Thumb big endian target machine.
124 class ThumbBETargetMachine : public ThumbTargetMachine {
125 void anchor() override;
127 ThumbBETargetMachine(const Target &T, StringRef TT, StringRef CPU,
128 StringRef FS, const TargetOptions &Options,
129 Reloc::Model RM, CodeModel::Model CM,
130 CodeGenOpt::Level OL);
133 } // end namespace llvm