Fixing a bunch of -Woverloaded-virtual warnings due to hiding getSubtargetImpl from...
[oota-llvm.git] / lib / Target / PowerPC / PPCTargetMachine.h
1 //===-- PPCTargetMachine.h - Define TargetMachine for PowerPC ---*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares the PowerPC specific subclass of TargetMachine.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_LIB_TARGET_POWERPC_PPCTARGETMACHINE_H
15 #define LLVM_LIB_TARGET_POWERPC_PPCTARGETMACHINE_H
16
17 #include "PPCInstrInfo.h"
18 #include "PPCSubtarget.h"
19 #include "llvm/IR/DataLayout.h"
20 #include "llvm/Target/TargetMachine.h"
21
22 namespace llvm {
23
24 /// PPCTargetMachine - Common code between 32-bit and 64-bit PowerPC targets.
25 ///
26 class PPCTargetMachine : public LLVMTargetMachine {
27   PPCSubtarget        Subtarget;
28
29 public:
30   PPCTargetMachine(const Target &T, StringRef TT,
31                    StringRef CPU, StringRef FS, const TargetOptions &Options,
32                    Reloc::Model RM, CodeModel::Model CM,
33                    CodeGenOpt::Level OL);
34
35   using LLVMTargetMachine::getSubtargetImpl;
36   const PPCSubtarget *getSubtargetImpl() const override { return &Subtarget; }
37
38   // Pass Pipeline Configuration
39   TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
40
41   /// \brief Register PPC analysis passes with a pass manager.
42   void addAnalysisPasses(PassManagerBase &PM) override;
43 };
44
45 /// PPC32TargetMachine - PowerPC 32-bit target machine.
46 ///
47 class PPC32TargetMachine : public PPCTargetMachine {
48   virtual void anchor();
49 public:
50   PPC32TargetMachine(const Target &T, StringRef TT,
51                      StringRef CPU, StringRef FS, const TargetOptions &Options,
52                      Reloc::Model RM, CodeModel::Model CM,
53                      CodeGenOpt::Level OL);
54 };
55
56 /// PPC64TargetMachine - PowerPC 64-bit target machine.
57 ///
58 class PPC64TargetMachine : public PPCTargetMachine {
59   virtual void anchor();
60 public:
61   PPC64TargetMachine(const Target &T, StringRef TT,
62                      StringRef CPU, StringRef FS, const TargetOptions &Options,
63                      Reloc::Model RM, CodeModel::Model CM,
64                      CodeGenOpt::Level OL);
65 };
66
67 } // end namespace llvm
68
69 #endif