1 //===-- SPIRVTargetMachine.h - Define TargetMachine for SPIR-V -*- C++ -*--===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // This file declares the SPIR-V specific subclass of TargetMachine. 10 // 11 //===----------------------------------------------------------------------===// 12 13 #ifndef LLVM_LIB_TARGET_SPIRV_SPIRVTARGETMACHINE_H 14 #define LLVM_LIB_TARGET_SPIRV_SPIRVTARGETMACHINE_H 15 16 #include "llvm/IR/DataLayout.h" 17 #include "llvm/Target/TargetMachine.h" 18 19 namespace llvm { 20 class SPIRVTargetMachine : public LLVMTargetMachine { 21 std::unique_ptr<TargetLoweringObjectFile> TLOF; 22 23 public: 24 SPIRVTargetMachine(const Target &T, const Triple &TT, StringRef CPU, 25 StringRef FS, const TargetOptions &Options, 26 Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM, 27 CodeGenOpt::Level OL, bool JIT); 28 29 TargetPassConfig *createPassConfig(PassManagerBase &PM) override; 30 31 TargetLoweringObjectFile *getObjFileLowering() const override { 32 return TLOF.get(); 33 } 34 }; 35 } // namespace llvm 36 37 #endif 38