Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 1 | //===-- X86TargetMachine.h - Define TargetMachine for the X86 ---*- C++ -*-===// |
| 2 | // |
| 3 | // This file declares the X86 specific subclass of TargetMachine. |
| 4 | // |
| 5 | //===----------------------------------------------------------------------===// |
| 6 | |
| 7 | #ifndef X86TARGETMACHINE_H |
| 8 | #define X86TARGETMACHINE_H |
| 9 | |
| 10 | #include "llvm/Target/TargetMachine.h" |
Chris Lattner | 8bd66e6 | 2002-12-28 21:00:25 +0000 | [diff] [blame] | 11 | #include "llvm/Target/TargetFrameInfo.h" |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 12 | #include "X86InstrInfo.h" |
| 13 | |
| 14 | class X86TargetMachine : public TargetMachine { |
Chris Lattner | fde4b51 | 2002-12-28 20:33:52 +0000 | [diff] [blame] | 15 | X86InstrInfo InstrInfo; |
| 16 | TargetFrameInfo FrameInfo; |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 17 | public: |
Chris Lattner | 5bcd95c | 2002-12-24 00:04:01 +0000 | [diff] [blame] | 18 | X86TargetMachine(unsigned Configuration); |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 19 | |
Chris Lattner | fde4b51 | 2002-12-28 20:33:52 +0000 | [diff] [blame] | 20 | virtual const X86InstrInfo &getInstrInfo() const { return InstrInfo; } |
| 21 | virtual const TargetFrameInfo &getFrameInfo() const { return FrameInfo; } |
| 22 | virtual const MRegisterInfo *getRegisterInfo() const { |
| 23 | return &InstrInfo.getRegisterInfo(); |
| 24 | } |
| 25 | |
Chris Lattner | d0f166a | 2002-12-29 03:13:05 +0000 | [diff] [blame^] | 26 | virtual const TargetSchedInfo &getSchedInfo() const { abort(); } |
| 27 | virtual const TargetRegInfo &getRegInfo() const { abort(); } |
Chris Lattner | f27eeea | 2002-12-29 02:50:35 +0000 | [diff] [blame] | 28 | virtual const TargetCacheInfo &getCacheInfo() const { abort(); } |
| 29 | virtual const TargetOptInfo &getOptInfo() const { abort(); } |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 30 | |
| 31 | /// addPassesToJITCompile - Add passes to the specified pass manager to |
| 32 | /// implement a fast dynamic compiler for this target. Return true if this is |
| 33 | /// not supported for this target. |
| 34 | /// |
| 35 | virtual bool addPassesToJITCompile(PassManager &PM); |
Chris Lattner | 40ead95 | 2002-12-02 21:24:12 +0000 | [diff] [blame] | 36 | |
| 37 | /// addPassesToEmitMachineCode - Add passes to the specified pass manager to |
| 38 | /// get machine code emitted. This uses a MAchineCodeEmitter object to handle |
| 39 | /// actually outputting the machine code and resolving things like the address |
| 40 | /// of functions. This method should returns true if machine code emission is |
| 41 | /// not supported. |
| 42 | /// |
| 43 | virtual bool addPassesToEmitMachineCode(PassManager &PM, |
| 44 | MachineCodeEmitter &MCE); |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 45 | }; |
| 46 | |
| 47 | #endif |