WebAssemblyTargetMachine.h revision 309124
1139743Simp// WebAssemblyTargetMachine.h - Define TargetMachine for WebAssembly -*- C++ -*- 2184691Sdes// 365577Sdes// The LLVM Compiler Infrastructure 459412Smsmith// 559412Smsmith// This file is distributed under the University of Illinois Open Source 659412Smsmith// License. See LICENSE.TXT for details. 759412Smsmith// 859412Smsmith//===----------------------------------------------------------------------===// 959412Smsmith/// 1059412Smsmith/// \file 1159412Smsmith/// \brief This file declares the WebAssembly-specific subclass of 1259412Smsmith/// TargetMachine. 1359412Smsmith/// 1459412Smsmith//===----------------------------------------------------------------------===// 1559412Smsmith 1659412Smsmith#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYTARGETMACHINE_H 1759412Smsmith#define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYTARGETMACHINE_H 1859412Smsmith 1959412Smsmith#include "WebAssemblySubtarget.h" 2059412Smsmith#include "llvm/Target/TargetMachine.h" 2159412Smsmith 2259412Smsmithnamespace llvm { 2359412Smsmith 2459412Smsmithclass WebAssemblyTargetMachine final : public LLVMTargetMachine { 2559412Smsmith std::unique_ptr<TargetLoweringObjectFile> TLOF; 2659412Smsmith mutable StringMap<std::unique_ptr<WebAssemblySubtarget>> SubtargetMap; 2759412Smsmith 2859412Smsmithpublic: 2959412Smsmith WebAssemblyTargetMachine(const Target &T, const Triple &TT, StringRef CPU, 3059412Smsmith StringRef FS, const TargetOptions &Options, 3159412Smsmith Optional<Reloc::Model> RM, CodeModel::Model CM, 3259412Smsmith CodeGenOpt::Level OL); 3359412Smsmith 3459412Smsmith ~WebAssemblyTargetMachine() override; 3559412Smsmith const WebAssemblySubtarget * 3659412Smsmith getSubtargetImpl(const Function &F) const override; 3759412Smsmith 3859412Smsmith // Pass Pipeline Configuration 3959412Smsmith TargetPassConfig *createPassConfig(PassManagerBase &PM) override; 4059412Smsmith 4159412Smsmith TargetLoweringObjectFile *getObjFileLowering() const override { 42182141Sjulian return TLOF.get(); 43182141Sjulian } 44116173Sobrien 45116173Sobrien /// \brief Get the TargetIRAnalysis for this target. 46116173Sobrien TargetIRAnalysis getTargetIRAnalysis() override; 4759412Smsmith 4883926Sdes bool usesPhysRegsForPEI() const override { return false; } 4976166Smarkm}; 5074135Sjlemon 5183926Sdes} // end namespace llvm 52177785Skib 53119911Sdes#endif 5476166Smarkm