xref: /llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.h (revision 6cca84e43c934344051252d4bc3a2f11d89ce1a2)
1 //===-- PPCTargetMachine.h - Define TargetMachine for PowerPC -----*- C++ -*-=//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
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.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares the PowerPC specific subclass of TargetMachine.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef PPC_TARGETMACHINE_H
15 #define PPC_TARGETMACHINE_H
16 
17 #include "PPCFrameInfo.h"
18 #include "PPCSubtarget.h"
19 #include "PPCJITInfo.h"
20 #include "PPCInstrInfo.h"
21 #include "llvm/Target/TargetMachine.h"
22 
23 namespace llvm {
24 class PassManager;
25 class IntrinsicLowering;
26 class GlobalValue;
27 class IntrinsicLowering;
28 
29 class PPCTargetMachine : public TargetMachine {
30   PPCInstrInfo    InstrInfo;
31   PPCSubtarget    Subtarget;
32   PPCFrameInfo    FrameInfo;
33   PPCJITInfo      JITInfo;
34 public:
35   PPCTargetMachine(const Module &M, IntrinsicLowering *IL,
36                    const std::string &FS);
37 
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 const MRegisterInfo    *getRegisterInfo() const {
43     return &InstrInfo.getRegisterInfo();
44   }
45 
46   static unsigned getJITMatchQuality();
47 
48   static unsigned getModuleMatchQuality(const Module &M);
49 
50   virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
51                                    CodeGenFileType FileType);
52 
53   bool addPassesToEmitMachineCode(FunctionPassManager &PM,
54                                   MachineCodeEmitter &MCE);
55 };
56 
57 } // end namespace llvm
58 
59 #endif
60