diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-09-03 00:03:49 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-09-03 00:03:49 +0000 |
commit | c3f44b0d636ff9a6d706ea9ac17ae77c8fa8aeff (patch) | |
tree | 4f9e053de03e708896309b59954e7f4e2092e824 /lib/Target/X86/X86FastISel.cpp | |
parent | c72139134cbd5be74e443ca632209d39df45cb78 (diff) |
Let tblgen only generate fastisel routines, not the class definition. This makes it easier for targets to define its own fastisel class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55679 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86FastISel.cpp')
-rw-r--r-- | lib/Target/X86/X86FastISel.cpp | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/lib/Target/X86/X86FastISel.cpp b/lib/Target/X86/X86FastISel.cpp index 34d8418095..5b825c2bdd 100644 --- a/lib/Target/X86/X86FastISel.cpp +++ b/lib/Target/X86/X86FastISel.cpp @@ -16,17 +16,31 @@ #include "X86.h" #include "X86RegisterInfo.h" #include "X86ISelLowering.h" -#include "X86FastISel.h" #include "X86TargetMachine.h" +#include "llvm/CodeGen/FastISel.h" #include "llvm/CodeGen/MachineRegisterInfo.h" -#include "X86GenFastISel.inc" -namespace llvm { +using namespace llvm; + +class X86FastISel : public FastISel { + /// Subtarget - Keep a pointer to the X86Subtarget around so that we can + /// make the right decision when generating code for different targets. + const X86Subtarget *Subtarget; + + public: + explicit X86FastISel(MachineFunction &mf) : FastISel(mf) {} + + virtual bool + TargetSelectInstruction(Instruction *I, + DenseMap<const Value *, unsigned> &ValueMap, + DenseMap<const BasicBlock *, MachineBasicBlock *> &MBBMap, + MachineBasicBlock *MBB); -namespace X86 { +#include "X86GenFastISel.inc" +}; bool -FastISel::TargetSelectInstruction(Instruction *I, +X86FastISel::TargetSelectInstruction(Instruction *I, DenseMap<const Value *, unsigned> &ValueMap, DenseMap<const BasicBlock *, MachineBasicBlock *> &MBBMap, MachineBasicBlock *MBB) { @@ -37,6 +51,8 @@ FastISel::TargetSelectInstruction(Instruction *I, return false; } -} - +namespace llvm { + llvm::FastISel *X86::createFastISel(MachineFunction &mf) { + return new X86FastISel(mf); + } } |