LLVM API Documentation
00001 //===-- PPCTargetMachine.h - Define TargetMachine for PowerPC ---*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file declares the PowerPC specific subclass of TargetMachine. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #ifndef LLVM_LIB_TARGET_POWERPC_PPCTARGETMACHINE_H 00015 #define LLVM_LIB_TARGET_POWERPC_PPCTARGETMACHINE_H 00016 00017 #include "PPCInstrInfo.h" 00018 #include "PPCSubtarget.h" 00019 #include "llvm/IR/DataLayout.h" 00020 #include "llvm/Target/TargetMachine.h" 00021 00022 namespace llvm { 00023 00024 /// PPCTargetMachine - Common code between 32-bit and 64-bit PowerPC targets. 00025 /// 00026 class PPCTargetMachine : public LLVMTargetMachine { 00027 PPCSubtarget Subtarget; 00028 00029 public: 00030 PPCTargetMachine(const Target &T, StringRef TT, 00031 StringRef CPU, StringRef FS, const TargetOptions &Options, 00032 Reloc::Model RM, CodeModel::Model CM, 00033 CodeGenOpt::Level OL); 00034 00035 const PPCSubtarget *getSubtargetImpl() const override { return &Subtarget; } 00036 00037 // Pass Pipeline Configuration 00038 TargetPassConfig *createPassConfig(PassManagerBase &PM) override; 00039 00040 /// \brief Register PPC analysis passes with a pass manager. 00041 void addAnalysisPasses(PassManagerBase &PM) override; 00042 }; 00043 00044 /// PPC32TargetMachine - PowerPC 32-bit target machine. 00045 /// 00046 class PPC32TargetMachine : public PPCTargetMachine { 00047 virtual void anchor(); 00048 public: 00049 PPC32TargetMachine(const Target &T, StringRef TT, 00050 StringRef CPU, StringRef FS, const TargetOptions &Options, 00051 Reloc::Model RM, CodeModel::Model CM, 00052 CodeGenOpt::Level OL); 00053 }; 00054 00055 /// PPC64TargetMachine - PowerPC 64-bit target machine. 00056 /// 00057 class PPC64TargetMachine : public PPCTargetMachine { 00058 virtual void anchor(); 00059 public: 00060 PPC64TargetMachine(const Target &T, StringRef TT, 00061 StringRef CPU, StringRef FS, const TargetOptions &Options, 00062 Reloc::Model RM, CodeModel::Model CM, 00063 CodeGenOpt::Level OL); 00064 }; 00065 00066 } // end namespace llvm 00067 00068 #endif