2004-08-17 04:55:41 +00:00
|
|
|
//===-- PPC32TargetMachine.h - Define TargetMachine for PowerPC -*- C++ -*-=//
|
2005-04-21 23:30:14 +00:00
|
|
|
//
|
2004-08-11 00:09:42 +00: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.
|
2005-04-21 23:30:14 +00:00
|
|
|
//
|
2004-08-11 00:09:42 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2005-04-21 23:30:14 +00:00
|
|
|
//
|
2004-08-17 04:55:41 +00:00
|
|
|
// This file declares the PowerPC specific subclass of TargetMachine.
|
2004-08-11 00:09:42 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2004-08-17 04:55:41 +00:00
|
|
|
#ifndef POWERPC32_TARGETMACHINE_H
|
|
|
|
#define POWERPC32_TARGETMACHINE_H
|
2004-08-11 00:09:42 +00:00
|
|
|
|
2005-10-14 23:51:18 +00:00
|
|
|
#include "PPCFrameInfo.h"
|
|
|
|
#include "PPCSubtarget.h"
|
2005-10-14 23:53:41 +00:00
|
|
|
#include "PPCJITInfo.h"
|
2005-10-14 23:59:06 +00:00
|
|
|
#include "PPCInstrInfo.h"
|
2005-10-14 23:44:05 +00:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
|
|
|
#include "llvm/Target/TargetFrameInfo.h"
|
2004-08-17 04:55:41 +00:00
|
|
|
#include "llvm/PassManager.h"
|
2004-08-11 00:09:42 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2005-10-14 23:44:05 +00:00
|
|
|
class IntrinsicLowering;
|
|
|
|
class GlobalValue;
|
2004-08-11 00:09:42 +00:00
|
|
|
class IntrinsicLowering;
|
|
|
|
|
2005-10-14 23:44:05 +00:00
|
|
|
// FIXME: Merge into only subclass.
|
|
|
|
class PowerPCTargetMachine : public TargetMachine {
|
|
|
|
PowerPCFrameInfo FrameInfo;
|
|
|
|
PPCSubtarget Subtarget;
|
|
|
|
protected:
|
|
|
|
PowerPCTargetMachine(const std::string &name, IntrinsicLowering *IL,
|
|
|
|
const Module &M, const std::string &FS,
|
|
|
|
const TargetData &TD,
|
|
|
|
const PowerPCFrameInfo &TFI);
|
|
|
|
public:
|
|
|
|
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
|
|
|
|
virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; }
|
|
|
|
|
|
|
|
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
|
|
|
|
CodeGenFileType FileType);
|
|
|
|
};
|
|
|
|
|
2004-08-11 00:09:42 +00:00
|
|
|
class PPC32TargetMachine : public PowerPCTargetMachine {
|
2004-08-17 04:55:41 +00:00
|
|
|
PPC32InstrInfo InstrInfo;
|
2004-11-23 05:56:40 +00:00
|
|
|
PPC32JITInfo JITInfo;
|
2004-08-17 04:55:41 +00:00
|
|
|
|
2004-08-11 00:09:42 +00:00
|
|
|
public:
|
2005-09-01 21:38:21 +00:00
|
|
|
PPC32TargetMachine(const Module &M, IntrinsicLowering *IL,
|
|
|
|
const std::string &FS);
|
2004-08-17 04:55:41 +00:00
|
|
|
virtual const PPC32InstrInfo *getInstrInfo() const { return &InstrInfo; }
|
|
|
|
virtual const MRegisterInfo *getRegisterInfo() const {
|
|
|
|
return &InstrInfo.getRegisterInfo();
|
|
|
|
}
|
2004-08-11 00:09:42 +00:00
|
|
|
|
2004-11-23 05:56:40 +00:00
|
|
|
virtual TargetJITInfo *getJITInfo() {
|
|
|
|
return &JITInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
static unsigned getJITMatchQuality();
|
|
|
|
|
2004-08-11 00:09:42 +00:00
|
|
|
static unsigned getModuleMatchQuality(const Module &M);
|
2004-08-17 04:55:41 +00:00
|
|
|
|
|
|
|
bool addPassesToEmitMachineCode(FunctionPassManager &PM,
|
|
|
|
MachineCodeEmitter &MCE);
|
2004-08-11 00:09:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|