//===- CastInterfaces.cpp -------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "mlir/Interfaces/CastInterfaces.h" #include "mlir/IR/BuiltinDialect.h" #include "mlir/IR/BuiltinOps.h" usingnamespacemlir; //===----------------------------------------------------------------------===// // Helper functions for CastOpInterface //===----------------------------------------------------------------------===// /// Attempt to fold the given cast operation. LogicalResult impl::foldCastInterfaceOp(Operation *op, ArrayRef<Attribute> attrOperands, SmallVectorImpl<OpFoldResult> &foldResults) { … } /// Attempt to verify the given cast operation. LogicalResult impl::verifyCastInterfaceOp(Operation *op) { … } //===----------------------------------------------------------------------===// // External model for BuiltinDialect ops //===----------------------------------------------------------------------===// namespace mlir { namespace { // This interface cannot be implemented directly on the op because the IR build // unit cannot depend on the Interfaces build unit. struct UnrealizedConversionCastOpInterface : CastOpInterface::ExternalModel<UnrealizedConversionCastOpInterface, UnrealizedConversionCastOp> { … }; } // namespace } // namespace mlir void mlir::builtin::registerCastOpInterfaceExternalModels( DialectRegistry ®istry) { … } //===----------------------------------------------------------------------===// // Table-generated class definitions //===----------------------------------------------------------------------===// #include "mlir/Interfaces/CastInterfaces.cpp.inc"