Chris Lattner | 02a3d83 | 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 | 871e591 | 2002-12-28 21:00:25 +0000 | [diff] [blame] | 11 | #include "llvm/Target/TargetFrameInfo.h" |
Brian Gaeke | 845b5af | 2003-08-13 18:17:27 +0000 | [diff] [blame] | 12 | #include "llvm/PassManager.h" |
Chris Lattner | 02a3d83 | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 13 | #include "X86InstrInfo.h" |
| 14 | |
| 15 | class X86TargetMachine : public TargetMachine { |
Chris Lattner | 362b26c | 2002-12-28 20:33:52 +0000 | [diff] [blame] | 16 | X86InstrInfo InstrInfo; |
| 17 | TargetFrameInfo FrameInfo; |
Chris Lattner | 02a3d83 | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 18 | public: |
Chris Lattner | 4fd144a | 2003-08-24 19:49:48 +0000 | [diff] [blame] | 19 | X86TargetMachine(const Module &M); |
Chris Lattner | 02a3d83 | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 20 | |
Chris Lattner | 362b26c | 2002-12-28 20:33:52 +0000 | [diff] [blame] | 21 | virtual const X86InstrInfo &getInstrInfo() const { return InstrInfo; } |
| 22 | virtual const TargetFrameInfo &getFrameInfo() const { return FrameInfo; } |
| 23 | virtual const MRegisterInfo *getRegisterInfo() const { |
| 24 | return &InstrInfo.getRegisterInfo(); |
| 25 | } |
| 26 | |
Chris Lattner | f9781b5 | 2002-12-29 03:13:05 +0000 | [diff] [blame] | 27 | virtual const TargetSchedInfo &getSchedInfo() const { abort(); } |
| 28 | virtual const TargetRegInfo &getRegInfo() const { abort(); } |
Chris Lattner | 42d5921 | 2002-12-29 02:50:35 +0000 | [diff] [blame] | 29 | virtual const TargetCacheInfo &getCacheInfo() const { abort(); } |
Chris Lattner | 02a3d83 | 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 | /// |
Brian Gaeke | 845b5af | 2003-08-13 18:17:27 +0000 | [diff] [blame] | 35 | virtual bool addPassesToJITCompile(FunctionPassManager &PM); |
Chris Lattner | 787a9de | 2002-12-02 21:24:12 +0000 | [diff] [blame] | 36 | |
| 37 | /// addPassesToEmitMachineCode - Add passes to the specified pass manager to |
Brian Gaeke | 845b5af | 2003-08-13 18:17:27 +0000 | [diff] [blame] | 38 | /// get machine code emitted. This uses a MachineCodeEmitter object to handle |
Chris Lattner | 787a9de | 2002-12-02 21:24:12 +0000 | [diff] [blame] | 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 | /// |
Brian Gaeke | 845b5af | 2003-08-13 18:17:27 +0000 | [diff] [blame] | 43 | virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM, |
Chris Lattner | 787a9de | 2002-12-02 21:24:12 +0000 | [diff] [blame] | 44 | MachineCodeEmitter &MCE); |
Brian Gaeke | ac94bab | 2003-06-18 21:43:21 +0000 | [diff] [blame] | 45 | |
| 46 | virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out); |
Brian Gaeke | 240fc39 | 2003-10-17 18:27:25 +0000 | [diff] [blame^] | 47 | |
| 48 | virtual bool replaceMachineCodeForFunction (void *Old, void *New); |
Chris Lattner | 02a3d83 | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | #endif |