Fix GCC build problem with 288f05f related to SmallVector. (#116958)
[llvm-project.git] / mlir / lib / Interfaces / ShapedOpInterfaces.cpp
blob5eda355f56d439e7b249a6b46187b0091be32199
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 //===----------------------------------------------------------------------===//
9 #include "mlir/Interfaces/ShapedOpInterfaces.h"
11 using namespace mlir;
13 //===----------------------------------------------------------------------===//
14 // ShapedDimOpInterface
15 //===----------------------------------------------------------------------===//
17 LogicalResult mlir::detail::verifyShapedDimOpInterface(Operation *op) {
18 if (op->getNumResults() != 1)
19 return op->emitError("expected single op result");
20 if (!op->getResult(0).getType().isIndex())
21 return op->emitError("expect index result type");
22 return success();
25 /// Include the definitions of the interface.
26 #include "mlir/Interfaces/ShapedOpInterfaces.cpp.inc"