MLIR: include/mlir/Support/WalkResult.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef MLIR_SUPPORT_WALKRESULT_H
14#define MLIR_SUPPORT_WALKRESULT_H
15
17
18namespace mlir {
21
22
23
24
25
26
27
28
30 enum ResultEnum { Interrupt, Advance, Skip } result;
31
32public:
33 WalkResult(ResultEnum result = Advance) : result(result) {}
34
35
37 : result(failed(result) ? Interrupt : Advance) {}
38
39
42
45
49
50
52
53
54 bool wasSkipped() const { return result == Skip; }
55};
56
57}
58
59#endif
This class contains all of the information necessary to report a diagnostic to the DiagnosticEngine.
This class represents a diagnostic that is inflight and set to be reported.
WalkResult(InFlightDiagnostic &&)
Definition WalkResult.h:41
bool operator==(const WalkResult &rhs) const
Definition WalkResult.h:43
WalkResult(LogicalResult result)
Allow LogicalResult to interrupt the walk on failure.
Definition WalkResult.h:36
WalkResult(ResultEnum result=Advance)
Definition WalkResult.h:33
static WalkResult skip()
Definition WalkResult.h:48
bool wasSkipped() const
Returns true if the walk was skipped.
Definition WalkResult.h:54
static WalkResult advance()
Definition WalkResult.h:47
bool wasInterrupted() const
Returns true if the walk was interrupted.
Definition WalkResult.h:51
WalkResult(Diagnostic &&)
Allow diagnostics to interrupt the walk.
Definition WalkResult.h:40
static WalkResult interrupt()
Definition WalkResult.h:46
bool operator!=(const WalkResult &rhs) const
Definition WalkResult.h:44
Include the generated interface declarations.