1 //===- SPIRVModule.h - SPIR-V Module Utilities ------------------*- 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 #ifndef MLIR_DIALECT_SPIRV_SPIRVMODULE_H 10 #define MLIR_DIALECT_SPIRV_SPIRVMODULE_H 11 12 #include "mlir/Dialect/SPIRV/SPIRVOps.h" 13 #include "mlir/IR/OwningOpRef.h" 14 15 namespace mlir { 16 namespace spirv { 17 18 /// This class acts as an owning reference to a SPIR-V module, and will 19 /// automatically destroy the held module on destruction if the held module 20 /// is valid. 21 // TODO: Remove this class in favor of using OwningOpRef directly. 22 class OwningSPIRVModuleRef : public OwningOpRef<spirv::ModuleOp> { 23 public: 24 using OwningOpRef<spirv::ModuleOp>::OwningOpRef; 25 }; 26 27 } // end namespace spirv 28 } // end namespace mlir 29 30 #endif // MLIR_DIALECT_SPIRV_SPIRVMODULE_H 31