2002-10-29 23:37:54 +01:00
|
|
|
//===-- X86TargetMachine.h - Define TargetMachine for the X86 ---*- C++ -*-===//
|
|
|
|
//
|
2003-10-21 17:17:13 +02:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by the LLVM research group and is distributed under
|
|
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2002-10-29 23:37:54 +01:00
|
|
|
// This file declares the X86 specific subclass of TargetMachine.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef X86TARGETMACHINE_H
|
|
|
|
#define X86TARGETMACHINE_H
|
|
|
|
|
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2002-12-28 22:00:25 +01:00
|
|
|
#include "llvm/Target/TargetFrameInfo.h"
|
2003-08-13 20:17:27 +02:00
|
|
|
#include "llvm/PassManager.h"
|
2002-10-29 23:37:54 +01:00
|
|
|
#include "X86InstrInfo.h"
|
|
|
|
|
2003-11-11 23:41:34 +01:00
|
|
|
namespace llvm {
|
|
|
|
|
2002-10-29 23:37:54 +01:00
|
|
|
class X86TargetMachine : public TargetMachine {
|
2002-12-28 21:33:52 +01:00
|
|
|
X86InstrInfo InstrInfo;
|
|
|
|
TargetFrameInfo FrameInfo;
|
2002-10-29 23:37:54 +01:00
|
|
|
public:
|
2003-08-24 21:49:48 +02:00
|
|
|
X86TargetMachine(const Module &M);
|
2002-10-29 23:37:54 +01:00
|
|
|
|
2002-12-28 21:33:52 +01:00
|
|
|
virtual const X86InstrInfo &getInstrInfo() const { return InstrInfo; }
|
|
|
|
virtual const TargetFrameInfo &getFrameInfo() const { return FrameInfo; }
|
|
|
|
virtual const MRegisterInfo *getRegisterInfo() const {
|
|
|
|
return &InstrInfo.getRegisterInfo();
|
|
|
|
}
|
|
|
|
|
2002-12-29 04:13:05 +01:00
|
|
|
virtual const TargetSchedInfo &getSchedInfo() const { abort(); }
|
|
|
|
virtual const TargetRegInfo &getRegInfo() const { abort(); }
|
2002-12-29 03:50:35 +01:00
|
|
|
virtual const TargetCacheInfo &getCacheInfo() const { abort(); }
|
2002-10-29 23:37:54 +01:00
|
|
|
|
|
|
|
/// addPassesToJITCompile - Add passes to the specified pass manager to
|
|
|
|
/// implement a fast dynamic compiler for this target. Return true if this is
|
|
|
|
/// not supported for this target.
|
|
|
|
///
|
2003-08-13 20:17:27 +02:00
|
|
|
virtual bool addPassesToJITCompile(FunctionPassManager &PM);
|
2002-12-02 22:24:12 +01:00
|
|
|
|
|
|
|
/// addPassesToEmitMachineCode - Add passes to the specified pass manager to
|
2003-08-13 20:17:27 +02:00
|
|
|
/// get machine code emitted. This uses a MachineCodeEmitter object to handle
|
2002-12-02 22:24:12 +01:00
|
|
|
/// actually outputting the machine code and resolving things like the address
|
|
|
|
/// of functions. This method should returns true if machine code emission is
|
|
|
|
/// not supported.
|
|
|
|
///
|
2003-08-13 20:17:27 +02:00
|
|
|
virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
|
2002-12-02 22:24:12 +01:00
|
|
|
MachineCodeEmitter &MCE);
|
2003-06-18 23:43:21 +02:00
|
|
|
|
|
|
|
virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
|
2003-10-17 20:27:25 +02:00
|
|
|
|
2003-10-20 19:59:09 +02:00
|
|
|
virtual void replaceMachineCodeForFunction (void *Old, void *New);
|
2002-10-29 23:37:54 +01:00
|
|
|
};
|
|
|
|
|
2003-11-11 23:41:34 +01:00
|
|
|
} // End llvm namespace
|
|
|
|
|
2002-10-29 23:37:54 +01:00
|
|
|
#endif
|