13 #ifndef MLIR_IR_OWNINGOPREF_H
14 #define MLIR_IR_OWNINGOPREF_H
16 #include <type_traits>
28 template <
typename OpTy>
51 OpTy
get()
const {
return op; }
56 if constexpr (std::is_pointer<OpTy>::value)
61 explicit operator bool()
const {
return op; }
68 OpTy released(
nullptr);
69 std::swap(released, op);
This class acts as an owning reference to an op, and will automatically destroy the held op on destru...
OpTy get() const
Allow accessing the internal op.
OpTy release()
Release the referenced op.
OwningOpRef & operator=(OwningOpRef &&other)
Assign from another op reference.
OpTy OperationT
The underlying operation type stored in this reference.
OwningOpRef(std::nullptr_t=nullptr)
OwningOpRef(OwningOpRef &&other)
Include the generated interface declarations.