Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 1 | //===-- X86TargetMachine.h - Define TargetMachine for the X86 ---*- C++ -*-===// |
Misha Brukman | 0e0a7a45 | 2005-04-21 23:38:14 +0000 | [diff] [blame] | 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. |
Misha Brukman | 0e0a7a45 | 2005-04-21 23:38:14 +0000 | [diff] [blame] | 7 | // |
John Criswell | 856ba76 | 2003-10-21 15:17:13 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
Misha Brukman | 0e0a7a45 | 2005-04-21 23:38:14 +0000 | [diff] [blame] | 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" |
Chris Lattner | 1e60a91 | 2003-12-20 01:22:19 +0000 | [diff] [blame] | 21 | #include "X86JITInfo.h" |
Nate Begeman | fb5792f | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 22 | #include "X86Subtarget.h" |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 23 | |
Brian Gaeke | d0fde30 | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 24 | namespace llvm { |
Chris Lattner | 4482715 | 2003-12-28 09:47:19 +0000 | [diff] [blame] | 25 | class IntrinsicLowering; |
Brian Gaeke | d0fde30 | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 26 | |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 27 | class X86TargetMachine : public TargetMachine { |
Chris Lattner | 1e60a91 | 2003-12-20 01:22:19 +0000 | [diff] [blame] | 28 | X86InstrInfo InstrInfo; |
Nate Begeman | fb5792f | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 29 | X86Subtarget Subtarget; |
Chris Lattner | fde4b51 | 2002-12-28 20:33:52 +0000 | [diff] [blame] | 30 | TargetFrameInfo FrameInfo; |
Chris Lattner | 1e60a91 | 2003-12-20 01:22:19 +0000 | [diff] [blame] | 31 | X86JITInfo JITInfo; |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 32 | public: |
Jim Laskey | b1e1180 | 2005-09-01 21:38:21 +0000 | [diff] [blame] | 33 | X86TargetMachine(const Module &M, IntrinsicLowering *IL, |
| 34 | const std::string &FS); |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 35 | |
Chris Lattner | d029cd2 | 2004-06-02 05:55:25 +0000 | [diff] [blame] | 36 | virtual const X86InstrInfo *getInstrInfo() const { return &InstrInfo; } |
| 37 | virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } |
Brian Gaeke | 05b15fb | 2004-03-01 06:43:29 +0000 | [diff] [blame] | 38 | virtual TargetJITInfo *getJITInfo() { return &JITInfo; } |
Nate Begeman | fb5792f | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 39 | virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; } |
Brian Gaeke | 05b15fb | 2004-03-01 06:43:29 +0000 | [diff] [blame] | 40 | virtual const MRegisterInfo *getRegisterInfo() const { |
Chris Lattner | fde4b51 | 2002-12-28 20:33:52 +0000 | [diff] [blame] | 41 | return &InstrInfo.getRegisterInfo(); |
| 42 | } |
| 43 | |
Brian Gaeke | 8844a0b | 2003-08-13 18:17:27 +0000 | [diff] [blame] | 44 | virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM, |
Chris Lattner | 40ead95 | 2002-12-02 21:24:12 +0000 | [diff] [blame] | 45 | MachineCodeEmitter &MCE); |
Misha Brukman | 0e0a7a45 | 2005-04-21 23:38:14 +0000 | [diff] [blame] | 46 | |
Chris Lattner | 0431c96 | 2005-06-25 02:48:37 +0000 | [diff] [blame] | 47 | virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out, |
Chris Lattner | ce8eb0c | 2005-11-08 02:11:51 +0000 | [diff] [blame] | 48 | CodeGenFileType FileType, bool Fast); |
Chris Lattner | d36c970 | 2004-07-11 02:48:49 +0000 | [diff] [blame] | 49 | |
| 50 | static unsigned getModuleMatchQuality(const Module &M); |
| 51 | static unsigned getJITMatchQuality(); |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 52 | }; |
Brian Gaeke | d0fde30 | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 53 | } // End llvm namespace |
| 54 | |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 55 | #endif |