diff options
author | Diana Picus <diana.picus@linaro.org> | 2017-04-28 09:10:38 +0000 |
---|---|---|
committer | Diana Picus <diana.picus@linaro.org> | 2017-04-28 09:10:38 +0000 |
commit | 674888d84c9af9e09721c4845ad0c574caf75b40 (patch) | |
tree | 5382563348a4a9bfef13e78dbe159b7b8f3105b5 /llvm/lib/Target/ARM/ARMInstructionSelector.cpp | |
parent | 96a3de272904f5190a5f531a4e9096d304cac29a (diff) | |
download | bcm5719-llvm-674888d84c9af9e09721c4845ad0c574caf75b40.tar.gz bcm5719-llvm-674888d84c9af9e09721c4845ad0c574caf75b40.zip |
[ARM] GlobalISel: Get rid of ARMInstructionSelector.h. NFC.
Declare the ARMInstructionSelector in an anonymous namespace, to make it
more in line with the other targets which were migrated to this in
r299637 in order to avoid TableGen'erated headers being included in
non-GlobalISel builds.
llvm-svn: 301632
Diffstat (limited to 'llvm/lib/Target/ARM/ARMInstructionSelector.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMInstructionSelector.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMInstructionSelector.cpp b/llvm/lib/Target/ARM/ARMInstructionSelector.cpp index 1c13d51a468..8ce8e322fe0 100644 --- a/llvm/lib/Target/ARM/ARMInstructionSelector.cpp +++ b/llvm/lib/Target/ARM/ARMInstructionSelector.cpp @@ -11,10 +11,10 @@ /// \todo This should be generated by TableGen. //===----------------------------------------------------------------------===// -#include "ARMInstructionSelector.h" #include "ARMRegisterBankInfo.h" #include "ARMSubtarget.h" #include "ARMTargetMachine.h" +#include "llvm/CodeGen/GlobalISel/InstructionSelector.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/Support/Debug.h" @@ -26,6 +26,29 @@ using namespace llvm; #error "You shouldn't build this" #endif +namespace { +class ARMInstructionSelector : public InstructionSelector { +public: + ARMInstructionSelector(const ARMSubtarget &STI, + const ARMRegisterBankInfo &RBI); + + bool select(MachineInstr &I) const override; + +private: + const ARMBaseInstrInfo &TII; + const ARMBaseRegisterInfo &TRI; + const ARMRegisterBankInfo &RBI; +}; +} // end anonymous namespace + +namespace llvm { +InstructionSelector * +createARMInstructionSelector(const ARMSubtarget &STI, + const ARMRegisterBankInfo &RBI) { + return new ARMInstructionSelector(STI, RBI); +} +} + ARMInstructionSelector::ARMInstructionSelector(const ARMSubtarget &STI, const ARMRegisterBankInfo &RBI) : InstructionSelector(), TII(*STI.getInstrInfo()), |