1//===- Verifier.h - Verifier analysis for MLIR structures -------*- C++ -*-===//
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#ifndef MLIR_IR_VERIFIER_H
10#define MLIR_IR_VERIFIER_H
11
12namespace mlir {
13struct LogicalResult;
14class Operation;
15
16/// Perform (potentially expensive) checks of invariants, used to detect
17/// compiler bugs, on this operation and any nested operations. On error, this
18/// reports the error through the MLIRContext and returns failure. If
19/// `verifyRecursively` is false, this assumes that nested operations have
20/// already been properly verified, and does not recursively invoke the verifier
21/// on nested operations.
22LogicalResult verify(Operation *op, bool verifyRecursively = true);
23
24} // namespace mlir
25
26#endif
27

source code of mlir/include/mlir/IR/Verifier.h