LLVM API Documentation
00001 //===-- CPPTargetMachine.h - TargetMachine for the C++ backend --*- 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 TargetMachine that is used by the C++ backend. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #ifndef LLVM_LIB_TARGET_CPPBACKEND_CPPTARGETMACHINE_H 00015 #define LLVM_LIB_TARGET_CPPBACKEND_CPPTARGETMACHINE_H 00016 00017 #include "llvm/IR/DataLayout.h" 00018 #include "llvm/Target/TargetMachine.h" 00019 #include "llvm/Target/TargetSubtargetInfo.h" 00020 00021 namespace llvm { 00022 00023 class formatted_raw_ostream; 00024 00025 class CPPSubtarget : public TargetSubtargetInfo { 00026 }; 00027 00028 struct CPPTargetMachine : public TargetMachine { 00029 CPPTargetMachine(const Target &T, StringRef TT, 00030 StringRef CPU, StringRef FS, const TargetOptions &Options, 00031 Reloc::Model RM, CodeModel::Model CM, 00032 CodeGenOpt::Level OL) 00033 : TargetMachine(T, TT, CPU, FS, Options), Subtarget() {} 00034 private: 00035 CPPSubtarget Subtarget; 00036 00037 public: 00038 const CPPSubtarget *getSubtargetImpl() const override { return &Subtarget; } 00039 bool addPassesToEmitFile(PassManagerBase &PM, formatted_raw_ostream &Out, 00040 CodeGenFileType FileType, bool DisableVerify, 00041 AnalysisID StartAfter, 00042 AnalysisID StopAfter) override; 00043 }; 00044 00045 extern Target TheCppBackendTarget; 00046 00047 } // End llvm namespace 00048 00049 00050 #endif