Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 1 | //===-- X86TargetMachine.h - Define TargetMachine for the X86 ---*- C++ -*-===// |
| 2 | // |
John Criswell | 856ba76 | 2003-10-21 15:17:13 +0000 | [diff] [blame^] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by the LLVM research group and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 10 | // This file declares the X86 specific subclass of TargetMachine. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef X86TARGETMACHINE_H |
| 15 | #define X86TARGETMACHINE_H |
| 16 | |
| 17 | #include "llvm/Target/TargetMachine.h" |
Chris Lattner | 8bd66e6 | 2002-12-28 21:00:25 +0000 | [diff] [blame] | 18 | #include "llvm/Target/TargetFrameInfo.h" |
Brian Gaeke | 8844a0b | 2003-08-13 18:17:27 +0000 | [diff] [blame] | 19 | #include "llvm/PassManager.h" |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 20 | #include "X86InstrInfo.h" |
| 21 | |
| 22 | class X86TargetMachine : public TargetMachine { |
Chris Lattner | fde4b51 | 2002-12-28 20:33:52 +0000 | [diff] [blame] | 23 | X86InstrInfo InstrInfo; |
| 24 | TargetFrameInfo FrameInfo; |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 25 | public: |
Chris Lattner | bb144a8 | 2003-08-24 19:49:48 +0000 | [diff] [blame] | 26 | X86TargetMachine(const Module &M); |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 27 | |
Chris Lattner | fde4b51 | 2002-12-28 20:33:52 +0000 | [diff] [blame] | 28 | virtual const X86InstrInfo &getInstrInfo() const { return InstrInfo; } |
| 29 | virtual const TargetFrameInfo &getFrameInfo() const { return FrameInfo; } |
| 30 | virtual const MRegisterInfo *getRegisterInfo() const { |
| 31 | return &InstrInfo.getRegisterInfo(); |
| 32 | } |
| 33 | |
Chris Lattner | d0f166a | 2002-12-29 03:13:05 +0000 | [diff] [blame] | 34 | virtual const TargetSchedInfo &getSchedInfo() const { abort(); } |
| 35 | virtual const TargetRegInfo &getRegInfo() const { abort(); } |
Chris Lattner | f27eeea | 2002-12-29 02:50:35 +0000 | [diff] [blame] | 36 | virtual const TargetCacheInfo &getCacheInfo() const { abort(); } |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 37 | |
| 38 | /// addPassesToJITCompile - Add passes to the specified pass manager to |
| 39 | /// implement a fast dynamic compiler for this target. Return true if this is |
| 40 | /// not supported for this target. |
| 41 | /// |
Brian Gaeke | 8844a0b | 2003-08-13 18:17:27 +0000 | [diff] [blame] | 42 | virtual bool addPassesToJITCompile(FunctionPassManager &PM); |
Chris Lattner | 40ead95 | 2002-12-02 21:24:12 +0000 | [diff] [blame] | 43 | |
| 44 | /// addPassesToEmitMachineCode - Add passes to the specified pass manager to |
Brian Gaeke | 8844a0b | 2003-08-13 18:17:27 +0000 | [diff] [blame] | 45 | /// get machine code emitted. This uses a MachineCodeEmitter object to handle |
Chris Lattner | 40ead95 | 2002-12-02 21:24:12 +0000 | [diff] [blame] | 46 | /// actually outputting the machine code and resolving things like the address |
| 47 | /// of functions. This method should returns true if machine code emission is |
| 48 | /// not supported. |
| 49 | /// |
Brian Gaeke | 8844a0b | 2003-08-13 18:17:27 +0000 | [diff] [blame] | 50 | virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM, |
Chris Lattner | 40ead95 | 2002-12-02 21:24:12 +0000 | [diff] [blame] | 51 | MachineCodeEmitter &MCE); |
Brian Gaeke | de3aa4f | 2003-06-18 21:43:21 +0000 | [diff] [blame] | 52 | |
| 53 | virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out); |
Brian Gaeke | 9a7871b | 2003-10-17 18:27:25 +0000 | [diff] [blame] | 54 | |
Brian Gaeke | 0522b08 | 2003-10-20 17:59:09 +0000 | [diff] [blame] | 55 | virtual void replaceMachineCodeForFunction (void *Old, void *New); |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 56 | }; |
| 57 | |
| 58 | #endif |