1 //===-- CPPTargetMachine.h - TargetMachine for the C++ backend --*- 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 TargetMachine that is used by the C++ backend.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_CPPBACKEND_CPPTARGETMACHINE_H
15 #define LLVM_LIB_TARGET_CPPBACKEND_CPPTARGETMACHINE_H
17 #include "llvm/IR/DataLayout.h"
18 #include "llvm/Target/TargetMachine.h"
19 #include "llvm/Target/TargetSubtargetInfo.h"
23 class formatted_raw_ostream;
25 class CPPSubtarget : public TargetSubtargetInfo {
28 struct CPPTargetMachine : public TargetMachine {
29 CPPTargetMachine(const Target &T, StringRef TT,
30 StringRef CPU, StringRef FS, const TargetOptions &Options,
31 Reloc::Model RM, CodeModel::Model CM,
33 : TargetMachine(T, TT, CPU, FS, Options), Subtarget() {}
35 CPPSubtarget Subtarget;
38 const CPPSubtarget *getSubtargetImpl() const override { return &Subtarget; }
39 bool addPassesToEmitFile(PassManagerBase &PM, formatted_raw_ostream &Out,
40 CodeGenFileType FileType, bool DisableVerify,
41 AnalysisID StartAfter,
42 AnalysisID StopAfter) override;
45 extern Target TheCppBackendTarget;
47 } // End llvm namespace