1//===- ShapedOpInterfaces.cpp - Interfaces for Shaped Ops -----------------===//
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#include "mlir/Interfaces/ShapedOpInterfaces.h"
10
11using namespace mlir;
12
13//===----------------------------------------------------------------------===//
14// ShapedDimOpInterface
15//===----------------------------------------------------------------------===//
16
17LogicalResult mlir::detail::verifyShapedDimOpInterface(Operation *op) {
18 if (op->getNumResults() != 1)
19 return op->emitError(message: "expected single op result");
20 if (!op->getResult(idx: 0).getType().isIndex())
21 return op->emitError(message: "expect index result type");
22 return success();
23}
24
25/// Include the definitions of the interface.
26#include "mlir/Interfaces/ShapedOpInterfaces.cpp.inc"
27

source code of mlir/lib/Interfaces/ShapedOpInterfaces.cpp