blob: 10f012a999187e951270c496787d2793a1aa670a [file] [log] [blame]
Chris Lattnerb4f68ed2002-10-29 22:37:54 +00001//===-- X86TargetMachine.h - Define TargetMachine for the X86 ---*- C++ -*-===//
Misha Brukman0e0a7a452005-04-21 23:38:14 +00002//
John Criswell856ba762003-10-21 15:17:13 +00003// 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 Brukman0e0a7a452005-04-21 23:38:14 +00007//
John Criswell856ba762003-10-21 15:17:13 +00008//===----------------------------------------------------------------------===//
Misha Brukman0e0a7a452005-04-21 23:38:14 +00009//
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000010// 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 Lattner8bd66e62002-12-28 21:00:25 +000018#include "llvm/Target/TargetFrameInfo.h"
Brian Gaeke8844a0b2003-08-13 18:17:27 +000019#include "llvm/PassManager.h"
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000020#include "X86InstrInfo.h"
Chris Lattner1e60a912003-12-20 01:22:19 +000021#include "X86JITInfo.h"
Nate Begemanfb5792f2005-07-12 01:41:54 +000022#include "X86Subtarget.h"
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000023
Brian Gaeked0fde302003-11-11 22:41:34 +000024namespace llvm {
Chris Lattner44827152003-12-28 09:47:19 +000025class IntrinsicLowering;
Brian Gaeked0fde302003-11-11 22:41:34 +000026
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000027class X86TargetMachine : public TargetMachine {
Chris Lattner1e60a912003-12-20 01:22:19 +000028 X86InstrInfo InstrInfo;
Nate Begemanfb5792f2005-07-12 01:41:54 +000029 X86Subtarget Subtarget;
Chris Lattnerfde4b512002-12-28 20:33:52 +000030 TargetFrameInfo FrameInfo;
Chris Lattner1e60a912003-12-20 01:22:19 +000031 X86JITInfo JITInfo;
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000032public:
Jim Laskeyb1e11802005-09-01 21:38:21 +000033 X86TargetMachine(const Module &M, IntrinsicLowering *IL,
34 const std::string &FS);
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000035
Chris Lattnerd029cd22004-06-02 05:55:25 +000036 virtual const X86InstrInfo *getInstrInfo() const { return &InstrInfo; }
37 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
Brian Gaeke05b15fb2004-03-01 06:43:29 +000038 virtual TargetJITInfo *getJITInfo() { return &JITInfo; }
Nate Begemanfb5792f2005-07-12 01:41:54 +000039 virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; }
Brian Gaeke05b15fb2004-03-01 06:43:29 +000040 virtual const MRegisterInfo *getRegisterInfo() const {
Chris Lattnerfde4b512002-12-28 20:33:52 +000041 return &InstrInfo.getRegisterInfo();
42 }
43
Brian Gaeke8844a0b2003-08-13 18:17:27 +000044 virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
Chris Lattner40ead952002-12-02 21:24:12 +000045 MachineCodeEmitter &MCE);
Misha Brukman0e0a7a452005-04-21 23:38:14 +000046
Chris Lattner0431c962005-06-25 02:48:37 +000047 virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
Chris Lattnerce8eb0c2005-11-08 02:11:51 +000048 CodeGenFileType FileType, bool Fast);
Chris Lattnerd36c9702004-07-11 02:48:49 +000049
50 static unsigned getModuleMatchQuality(const Module &M);
51 static unsigned getJITMatchQuality();
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000052};
Brian Gaeked0fde302003-11-11 22:41:34 +000053} // End llvm namespace
54
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000055#endif