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 "PPC32InstrInfo.h"
21 #include "llvm/Target/TargetMachine.h"
22 #include "llvm/Target/TargetFrameInfo.h"
23 #include "llvm/PassManager.h"
27 class IntrinsicLowering;
29 class IntrinsicLowering;
31 // FIXME: Merge into only subclass.
32 class PowerPCTargetMachine : public TargetMachine {
33 PowerPCFrameInfo FrameInfo;
34 PPCSubtarget Subtarget;
36 PowerPCTargetMachine(const std::string &name, IntrinsicLowering *IL,
37 const Module &M, const std::string &FS,
39 const PowerPCFrameInfo &TFI);
41 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
42 virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; }
44 virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
45 CodeGenFileType FileType);
48 class PPC32TargetMachine : public PowerPCTargetMachine {
49 PPC32InstrInfo InstrInfo;
53 PPC32TargetMachine(const Module &M, IntrinsicLowering *IL,
54 const std::string &FS);
55 virtual const PPC32InstrInfo *getInstrInfo() const { return &InstrInfo; }
56 virtual const MRegisterInfo *getRegisterInfo() const {
57 return &InstrInfo.getRegisterInfo();
60 virtual TargetJITInfo *getJITInfo() {
64 static unsigned getJITMatchQuality();
66 static unsigned getModuleMatchQuality(const Module &M);
68 bool addPassesToEmitMachineCode(FunctionPassManager &PM,
69 MachineCodeEmitter &MCE);
72 } // end namespace llvm