Add out of line virtual destructors to all LLVMTargetMachine subclasses
[oota-llvm.git] / lib / Target / ARM / ARMTargetMachine.h
1 //===-- ARMTargetMachine.h - Define TargetMachine for ARM -------*- 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 ARM specific subclass of TargetMachine.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_LIB_TARGET_ARM_ARMTARGETMACHINE_H
15 #define LLVM_LIB_TARGET_ARM_ARMTARGETMACHINE_H
16
17 #include "ARMInstrInfo.h"
18 #include "ARMSubtarget.h"
19 #include "llvm/IR/DataLayout.h"
20 #include "llvm/Target/TargetMachine.h"
21
22 namespace llvm {
23
24 class ARMBaseTargetMachine : public LLVMTargetMachine {
25 protected:
26   std::unique_ptr<TargetLoweringObjectFile> TLOF;
27   ARMSubtarget        Subtarget;
28   bool isLittle;
29   mutable StringMap<std::unique_ptr<ARMSubtarget>> SubtargetMap;
30
31 public:
32   ARMBaseTargetMachine(const Target &T, StringRef TT,
33                        StringRef CPU, StringRef FS,
34                        const TargetOptions &Options,
35                        Reloc::Model RM, CodeModel::Model CM,
36                        CodeGenOpt::Level OL,
37                        bool isLittle);
38   ~ARMBaseTargetMachine() override;
39
40   const ARMSubtarget *getSubtargetImpl() const override { return &Subtarget; }
41   const ARMSubtarget *getSubtargetImpl(const Function &F) const override;
42
43   /// \brief Register ARM analysis passes with a pass manager.
44   void addAnalysisPasses(PassManagerBase &PM) override;
45
46   // Pass Pipeline Configuration
47   TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
48
49   TargetLoweringObjectFile *getObjFileLowering() const override {
50     return TLOF.get();
51   }
52 };
53
54 /// ARMTargetMachine - ARM target machine.
55 ///
56 class ARMTargetMachine : public ARMBaseTargetMachine {
57   virtual void anchor();
58  public:
59    ARMTargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS,
60                     const TargetOptions &Options, Reloc::Model RM,
61                     CodeModel::Model CM, CodeGenOpt::Level OL, bool isLittle);
62 };
63
64 /// ARMLETargetMachine - ARM little endian target machine.
65 ///
66 class ARMLETargetMachine : public ARMTargetMachine {
67   void anchor() override;
68 public:
69   ARMLETargetMachine(const Target &T, StringRef TT,
70                      StringRef CPU, StringRef FS, const TargetOptions &Options,
71                      Reloc::Model RM, CodeModel::Model CM,
72                      CodeGenOpt::Level OL);
73 };
74
75 /// ARMBETargetMachine - ARM big endian target machine.
76 ///
77 class ARMBETargetMachine : public ARMTargetMachine {
78   void anchor() override;
79 public:
80   ARMBETargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS,
81                      const TargetOptions &Options, Reloc::Model RM,
82                      CodeModel::Model CM, CodeGenOpt::Level OL);
83 };
84
85 /// ThumbTargetMachine - Thumb target machine.
86 /// Due to the way architectures are handled, this represents both
87 ///   Thumb-1 and Thumb-2.
88 ///
89 class ThumbTargetMachine : public ARMBaseTargetMachine {
90   virtual void anchor();
91 public:
92   ThumbTargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS,
93                      const TargetOptions &Options, Reloc::Model RM,
94                      CodeModel::Model CM, CodeGenOpt::Level OL, bool isLittle);
95 };
96
97 /// ThumbLETargetMachine - Thumb little endian target machine.
98 ///
99 class ThumbLETargetMachine : public ThumbTargetMachine {
100   void anchor() override;
101 public:
102   ThumbLETargetMachine(const Target &T, StringRef TT, StringRef CPU,
103                        StringRef FS, const TargetOptions &Options,
104                        Reloc::Model RM, CodeModel::Model CM,
105                        CodeGenOpt::Level OL);
106 };
107
108 /// ThumbBETargetMachine - Thumb big endian target machine.
109 ///
110 class ThumbBETargetMachine : public ThumbTargetMachine {
111   void anchor() override;
112 public:
113   ThumbBETargetMachine(const Target &T, StringRef TT, StringRef CPU,
114                        StringRef FS, const TargetOptions &Options,
115                        Reloc::Model RM, CodeModel::Model CM,
116                        CodeGenOpt::Level OL);
117 };
118
119 } // end namespace llvm
120
121 #endif