59 lines
2.8 KiB
C++
59 lines
2.8 KiB
C++
/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
|
|
|* *|
|
|
|* Dialect Interface Declarations *|
|
|
|* *|
|
|
|* Automatically generated file, do not edit! *|
|
|
|* *|
|
|
\*===----------------------------------------------------------------------===*/
|
|
|
|
namespace mlir {
|
|
|
|
/// Dialect OpAsm interface
|
|
class OpAsmDialectInterface : public ::mlir::DialectInterface::Base<OpAsmDialectInterface> {
|
|
public:
|
|
|
|
/// Hooks for getting an alias identifier alias for a given symbol, that is
|
|
/// not necessarily a part of this dialect. The identifier is used in place of
|
|
/// the symbol when printing textual IR. These aliases must not contain `.` or
|
|
/// end with a numeric digit ([0-9]+).
|
|
virtual OpAsmAliasResult getAlias(::mlir::Attribute attr, ::llvm::raw_ostream & os) const {
|
|
return OpAsmAliasResult::NoAlias;
|
|
}
|
|
|
|
virtual OpAsmAliasResult getAlias(::mlir::Type type, ::llvm::raw_ostream & os) const {
|
|
return OpAsmAliasResult::NoAlias;
|
|
}
|
|
|
|
/// Declare a resource with the given key, returning a handle to use for any
|
|
/// references of this resource key within the IR during parsing. The result
|
|
/// of `getResourceKey` on the returned handle is permitted to be different
|
|
/// than `key`.
|
|
virtual ::mlir::FailureOr<::mlir::AsmDialectResourceHandle> declareResource(::mlir::StringRef key) const {
|
|
return failure();
|
|
}
|
|
|
|
/// Return a key to use for the given resource. This key should uniquely
|
|
/// identify this resource within the dialect.
|
|
virtual std::string getResourceKey(const ::mlir::AsmDialectResourceHandle & handle) const {
|
|
llvm_unreachable(
|
|
"Dialect must implement `getResourceKey` when defining resources");
|
|
}
|
|
|
|
/// Hook for parsing resource entries. Returns failure if the entry was not
|
|
/// valid, or could otherwise not be processed correctly. Any necessary errors
|
|
/// can be emitted via the provided entry.
|
|
virtual ::llvm::LogicalResult parseResource(::mlir::AsmParsedResourceEntry & entry) const;
|
|
|
|
/// Hook for building resources to use during printing. The given `op` may be
|
|
/// inspected to help determine what information to include.
|
|
/// `referencedResources` contains all of the resources detected when printing
|
|
/// 'op'.
|
|
virtual void buildResources(::mlir::Operation * op, const ::mlir::SetVector<::mlir::AsmDialectResourceHandle> & referencedResources, ::mlir::AsmResourceBuilder & builder) const {}
|
|
using AliasResult = OpAsmAliasResult;
|
|
|
|
|
|
OpAsmDialectInterface(::mlir::Dialect *dialect) : Base(dialect) {}
|
|
};
|
|
|
|
} // namespace mlir
|