1 //===-- PPCTargetMachine.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 PPC_TARGETMACHINE_H
15 #define PPC_TARGETMACHINE_H
17 #include "PPCFrameInfo.h"
18 #include "PPCSubtarget.h"
19 #include "PPCJITInfo.h"
20 #include "PPCInstrInfo.h"
21 #include "PPCISelLowering.h"
22 #include "llvm/Target/TargetMachine.h"
28 class PPCTargetMachine : public TargetMachine {
29 PPCInstrInfo InstrInfo;
30 PPCSubtarget Subtarget;
31 PPCFrameInfo FrameInfo;
33 PPCTargetLowering TLInfo;
34 InstrItineraryData InstrItins;
36 PPCTargetMachine(const Module &M, const std::string &FS);
38 virtual const PPCInstrInfo *getInstrInfo() const { return &InstrInfo; }
39 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
40 virtual TargetJITInfo *getJITInfo() { return &JITInfo; }
41 virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; }
42 virtual PPCTargetLowering *getTargetLowering() { return &TLInfo; }
43 virtual const MRegisterInfo *getRegisterInfo() const {
44 return &InstrInfo.getRegisterInfo();
46 virtual const InstrItineraryData getInstrItineraryData() const {
51 static unsigned getJITMatchQuality();
53 static unsigned getModuleMatchQuality(const Module &M);
55 virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
56 CodeGenFileType FileType, bool Fast);
58 bool addPassesToEmitMachineCode(FunctionPassManager &PM,
59 MachineCodeEmitter &MCE);
62 } // end namespace llvm