1 //===-- PPC32TargetMachine.h - Define TargetMachine for PowerPC -*- C++ -*-=//
3 // The LLVM Compiler Infrastructure
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.
8 //===----------------------------------------------------------------------===//
10 // This file declares the PowerPC specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef POWERPC32_TARGETMACHINE_H
15 #define POWERPC32_TARGETMACHINE_H
17 #include "PPCFrameInfo.h"
18 #include "PPCSubtarget.h"
19 #include "PPCJITInfo.h"
20 #include "PPCInstrInfo.h"
21 #include "llvm/Target/TargetMachine.h"
25 class IntrinsicLowering;
27 class IntrinsicLowering;
29 // FIXME: Merge into only subclass.
30 class PowerPCTargetMachine : public TargetMachine {
31 PowerPCFrameInfo FrameInfo;
32 PPCSubtarget Subtarget;
34 PowerPCTargetMachine(const std::string &name, IntrinsicLowering *IL,
35 const Module &M, const std::string &FS,
37 const PowerPCFrameInfo &TFI);
39 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
40 virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; }
42 virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
43 CodeGenFileType FileType);
46 class PPC32TargetMachine : public PowerPCTargetMachine {
47 PPC32InstrInfo InstrInfo;
51 PPC32TargetMachine(const Module &M, IntrinsicLowering *IL,
52 const std::string &FS);
53 virtual const PPC32InstrInfo *getInstrInfo() const { return &InstrInfo; }
54 virtual const MRegisterInfo *getRegisterInfo() const {
55 return &InstrInfo.getRegisterInfo();
58 virtual TargetJITInfo *getJITInfo() {
62 static unsigned getJITMatchQuality();
64 static unsigned getModuleMatchQuality(const Module &M);
66 bool addPassesToEmitMachineCode(FunctionPassManager &PM,
67 MachineCodeEmitter &MCE);
70 } // end namespace llvm