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 LLVM_LIB_TARGET_ARM_ARMTARGETMACHINE_H
15 #define LLVM_LIB_TARGET_ARM_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 {
29 ARM_ABI_AAPCS // ARM EABI
33 std::unique_ptr<TargetLoweringObjectFile> TLOF;
34 ARMSubtarget Subtarget;
36 mutable StringMap<std::unique_ptr<ARMSubtarget>> SubtargetMap;
39 ARMBaseTargetMachine(const Target &T, StringRef TT,
40 StringRef CPU, StringRef FS,
41 const TargetOptions &Options,
42 Reloc::Model RM, CodeModel::Model CM,
45 ~ARMBaseTargetMachine() override;
47 const ARMSubtarget *getSubtargetImpl() const override { return &Subtarget; }
48 const ARMSubtarget *getSubtargetImpl(const Function &F) const override;
49 bool isLittleEndian() const { return isLittle; }
51 /// \brief Get the TargetIRAnalysis for this target.
52 TargetIRAnalysis getTargetIRAnalysis() override;
54 // Pass Pipeline Configuration
55 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
57 TargetLoweringObjectFile *getObjFileLowering() const override {
62 /// ARMTargetMachine - ARM target machine.
64 class ARMTargetMachine : public ARMBaseTargetMachine {
65 virtual void anchor();
67 ARMTargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS,
68 const TargetOptions &Options, Reloc::Model RM,
69 CodeModel::Model CM, CodeGenOpt::Level OL, bool isLittle);
72 /// ARMLETargetMachine - ARM little endian target machine.
74 class ARMLETargetMachine : public ARMTargetMachine {
75 void anchor() override;
77 ARMLETargetMachine(const Target &T, StringRef TT,
78 StringRef CPU, StringRef FS, const TargetOptions &Options,
79 Reloc::Model RM, CodeModel::Model CM,
80 CodeGenOpt::Level OL);
83 /// ARMBETargetMachine - ARM big endian target machine.
85 class ARMBETargetMachine : public ARMTargetMachine {
86 void anchor() override;
88 ARMBETargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS,
89 const TargetOptions &Options, Reloc::Model RM,
90 CodeModel::Model CM, CodeGenOpt::Level OL);
93 /// ThumbTargetMachine - Thumb target machine.
94 /// Due to the way architectures are handled, this represents both
95 /// Thumb-1 and Thumb-2.
97 class ThumbTargetMachine : public ARMBaseTargetMachine {
98 virtual void anchor();
100 ThumbTargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS,
101 const TargetOptions &Options, Reloc::Model RM,
102 CodeModel::Model CM, CodeGenOpt::Level OL, bool isLittle);
105 /// ThumbLETargetMachine - Thumb little endian target machine.
107 class ThumbLETargetMachine : public ThumbTargetMachine {
108 void anchor() override;
110 ThumbLETargetMachine(const Target &T, StringRef TT, StringRef CPU,
111 StringRef FS, const TargetOptions &Options,
112 Reloc::Model RM, CodeModel::Model CM,
113 CodeGenOpt::Level OL);
116 /// ThumbBETargetMachine - Thumb big endian target machine.
118 class ThumbBETargetMachine : public ThumbTargetMachine {
119 void anchor() override;
121 ThumbBETargetMachine(const Target &T, StringRef TT, StringRef CPU,
122 StringRef FS, const TargetOptions &Options,
123 Reloc::Model RM, CodeModel::Model CM,
124 CodeGenOpt::Level OL);
127 } // end namespace llvm