2005-10-16 07:39:50 +02:00
|
|
|
//===-- PPCTargetMachine.h - Define TargetMachine for PowerPC -----*- C++ -*-=//
|
2005-04-22 01:30:14 +02:00
|
|
|
//
|
2004-08-11 02:09:42 +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.
|
2005-04-22 01:30:14 +02:00
|
|
|
//
|
2004-08-11 02:09:42 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
2005-04-22 01:30:14 +02:00
|
|
|
//
|
2004-08-17 06:55:41 +02:00
|
|
|
// This file declares the PowerPC specific subclass of TargetMachine.
|
2004-08-11 02:09:42 +02:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2005-10-16 07:39:50 +02:00
|
|
|
#ifndef PPC_TARGETMACHINE_H
|
|
|
|
#define PPC_TARGETMACHINE_H
|
2004-08-11 02:09:42 +02:00
|
|
|
|
2005-10-15 01:51:18 +02:00
|
|
|
#include "PPCFrameInfo.h"
|
|
|
|
#include "PPCSubtarget.h"
|
2005-10-15 01:53:41 +02:00
|
|
|
#include "PPCJITInfo.h"
|
2005-10-15 01:59:06 +02:00
|
|
|
#include "PPCInstrInfo.h"
|
2006-03-14 00:20:37 +01:00
|
|
|
#include "PPCISelLowering.h"
|
2007-01-24 04:41:36 +01:00
|
|
|
#include "PPCMachOWriterInfo.h"
|
2005-10-15 01:44:05 +02:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2006-05-12 08:33:49 +02:00
|
|
|
#include "llvm/Target/TargetData.h"
|
2004-08-11 02:09:42 +02:00
|
|
|
|
|
|
|
namespace llvm {
|
2005-10-15 23:58:54 +02:00
|
|
|
class PassManager;
|
2005-10-15 01:44:05 +02:00
|
|
|
class GlobalValue;
|
2004-08-11 02:09:42 +02:00
|
|
|
|
2006-06-16 03:37:27 +02:00
|
|
|
/// PPCTargetMachine - Common code between 32-bit and 64-bit PowerPC targets.
|
|
|
|
///
|
2006-09-04 06:14:57 +02:00
|
|
|
class PPCTargetMachine : public LLVMTargetMachine {
|
2006-06-16 03:37:27 +02:00
|
|
|
PPCSubtarget Subtarget;
|
|
|
|
const TargetData DataLayout; // Calculates type size & alignment
|
|
|
|
PPCInstrInfo InstrInfo;
|
|
|
|
PPCFrameInfo FrameInfo;
|
|
|
|
PPCJITInfo JITInfo;
|
|
|
|
PPCTargetLowering TLInfo;
|
|
|
|
InstrItineraryData InstrItins;
|
2007-01-24 04:41:36 +01:00
|
|
|
PPCMachOWriterInfo MachOWriterInfo;
|
|
|
|
|
2006-09-08 01:39:26 +02:00
|
|
|
protected:
|
|
|
|
virtual const TargetAsmInfo *createTargetAsmInfo() const;
|
|
|
|
|
2005-10-15 01:44:05 +02:00
|
|
|
public:
|
2006-06-16 03:37:27 +02:00
|
|
|
PPCTargetMachine(const Module &M, const std::string &FS, bool is64Bit);
|
2005-10-16 07:39:50 +02:00
|
|
|
|
|
|
|
virtual const PPCInstrInfo *getInstrInfo() const { return &InstrInfo; }
|
2005-10-15 01:44:05 +02:00
|
|
|
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
|
2005-10-16 07:39:50 +02:00
|
|
|
virtual TargetJITInfo *getJITInfo() { return &JITInfo; }
|
2006-05-12 23:09:57 +02:00
|
|
|
virtual PPCTargetLowering *getTargetLowering() const {
|
|
|
|
return const_cast<PPCTargetLowering*>(&TLInfo);
|
|
|
|
}
|
2005-10-16 07:39:50 +02:00
|
|
|
virtual const MRegisterInfo *getRegisterInfo() const {
|
2004-08-17 06:55:41 +02:00
|
|
|
return &InstrInfo.getRegisterInfo();
|
|
|
|
}
|
2006-06-16 03:37:27 +02:00
|
|
|
|
|
|
|
virtual const TargetData *getTargetData() const { return &DataLayout; }
|
|
|
|
virtual const PPCSubtarget *getSubtargetImpl() const { return &Subtarget; }
|
2005-11-01 21:06:59 +01:00
|
|
|
virtual const InstrItineraryData getInstrItineraryData() const {
|
|
|
|
return InstrItins;
|
|
|
|
}
|
2007-01-24 04:41:36 +01:00
|
|
|
virtual const PPCMachOWriterInfo *getMachOWriterInfo() const {
|
|
|
|
return &MachOWriterInfo;
|
|
|
|
}
|
2005-11-01 21:06:59 +01:00
|
|
|
|
2006-09-04 06:14:57 +02:00
|
|
|
// Pass Pipeline Configuration
|
|
|
|
virtual bool addInstSelector(FunctionPassManager &PM, bool Fast);
|
|
|
|
virtual bool addPreEmitPass(FunctionPassManager &PM, bool Fast);
|
|
|
|
virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
|
|
|
|
std::ostream &Out);
|
|
|
|
virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast,
|
|
|
|
MachineCodeEmitter &MCE);
|
2007-02-08 02:39:44 +01:00
|
|
|
virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast,
|
|
|
|
MachineCodeEmitter &MCE);
|
2004-08-11 02:09:42 +02:00
|
|
|
};
|
2006-06-16 03:37:27 +02:00
|
|
|
|
|
|
|
/// PPC32TargetMachine - PowerPC 32-bit target machine.
|
|
|
|
///
|
|
|
|
class PPC32TargetMachine : public PPCTargetMachine {
|
|
|
|
public:
|
|
|
|
PPC32TargetMachine(const Module &M, const std::string &FS);
|
2005-10-16 07:39:50 +02:00
|
|
|
|
2006-06-16 03:37:27 +02:00
|
|
|
static unsigned getJITMatchQuality();
|
|
|
|
static unsigned getModuleMatchQuality(const Module &M);
|
|
|
|
};
|
|
|
|
|
|
|
|
/// PPC64TargetMachine - PowerPC 64-bit target machine.
|
|
|
|
///
|
|
|
|
class PPC64TargetMachine : public PPCTargetMachine {
|
|
|
|
public:
|
|
|
|
PPC64TargetMachine(const Module &M, const std::string &FS);
|
|
|
|
|
|
|
|
static unsigned getJITMatchQuality();
|
|
|
|
static unsigned getModuleMatchQuality(const Module &M);
|
|
|
|
};
|
|
|
|
|
2004-08-11 02:09:42 +02:00
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|