1 //===-- PPCTargetMachine.h - Define TargetMachine for PowerPC ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // 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 "PPCInstrInfo.h"
18 #include "PPCSubtarget.h"
19 #include "llvm/IR/DataLayout.h"
20 #include "llvm/Target/TargetMachine.h"
24 /// PPCTargetMachine - Common code between 32-bit and 64-bit PowerPC targets.
26 class PPCTargetMachine : public LLVMTargetMachine {
27 PPCSubtarget Subtarget;
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, bool is64Bit);
35 const PPCSubtarget *getSubtargetImpl() const override { return &Subtarget; }
36 PPCSubtarget *getSubtargetImpl() override { return &Subtarget; }
38 // Pass Pipeline Configuration
39 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
40 bool addCodeEmitter(PassManagerBase &PM,
41 JITCodeEmitter &JCE) override;
43 /// \brief Register PPC analysis passes with a pass manager.
44 void addAnalysisPasses(PassManagerBase &PM) override;
47 /// PPC32TargetMachine - PowerPC 32-bit target machine.
49 class PPC32TargetMachine : public PPCTargetMachine {
50 virtual void anchor();
52 PPC32TargetMachine(const Target &T, StringRef TT,
53 StringRef CPU, StringRef FS, const TargetOptions &Options,
54 Reloc::Model RM, CodeModel::Model CM,
55 CodeGenOpt::Level OL);
58 /// PPC64TargetMachine - PowerPC 64-bit target machine.
60 class PPC64TargetMachine : public PPCTargetMachine {
61 virtual void anchor();
63 PPC64TargetMachine(const Target &T, StringRef TT,
64 StringRef CPU, StringRef FS, const TargetOptions &Options,
65 Reloc::Model RM, CodeModel::Model CM,
66 CodeGenOpt::Level OL);
69 } // end namespace llvm