blob: 07c46089f2acbb28c0fddfe260dcdc21205b61b2 [file] [log] [blame]
Chris Lattnerb4f68ed2002-10-29 22:37:54 +00001//===-- 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 Lattner8bd66e62002-12-28 21:00:25 +000011#include "llvm/Target/TargetFrameInfo.h"
Brian Gaeke8844a0b2003-08-13 18:17:27 +000012#include "llvm/PassManager.h"
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000013#include "X86InstrInfo.h"
14
15class X86TargetMachine : public TargetMachine {
Chris Lattnerfde4b512002-12-28 20:33:52 +000016 X86InstrInfo InstrInfo;
17 TargetFrameInfo FrameInfo;
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000018public:
Chris Lattnerbb144a82003-08-24 19:49:48 +000019 X86TargetMachine(const Module &M);
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000020
Chris Lattnerfde4b512002-12-28 20:33:52 +000021 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 Lattnerd0f166a2002-12-29 03:13:05 +000027 virtual const TargetSchedInfo &getSchedInfo() const { abort(); }
28 virtual const TargetRegInfo &getRegInfo() const { abort(); }
Chris Lattnerf27eeea2002-12-29 02:50:35 +000029 virtual const TargetCacheInfo &getCacheInfo() const { abort(); }
30 virtual const TargetOptInfo &getOptInfo() const { abort(); }
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000031
32 /// addPassesToJITCompile - Add passes to the specified pass manager to
33 /// implement a fast dynamic compiler for this target. Return true if this is
34 /// not supported for this target.
35 ///
Brian Gaeke8844a0b2003-08-13 18:17:27 +000036 virtual bool addPassesToJITCompile(FunctionPassManager &PM);
Chris Lattner40ead952002-12-02 21:24:12 +000037
38 /// addPassesToEmitMachineCode - Add passes to the specified pass manager to
Brian Gaeke8844a0b2003-08-13 18:17:27 +000039 /// get machine code emitted. This uses a MachineCodeEmitter object to handle
Chris Lattner40ead952002-12-02 21:24:12 +000040 /// actually outputting the machine code and resolving things like the address
41 /// of functions. This method should returns true if machine code emission is
42 /// not supported.
43 ///
Brian Gaeke8844a0b2003-08-13 18:17:27 +000044 virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
Chris Lattner40ead952002-12-02 21:24:12 +000045 MachineCodeEmitter &MCE);
Brian Gaekede3aa4f2003-06-18 21:43:21 +000046
47 virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000048};
49
50#endif