CIRCT 23.0.0git
Loading...
Searching...
No Matches
ProceduralRegionTrait.cpp
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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
10
11using namespace llvm;
12using namespace mlir;
13
14namespace circt {
15
16LogicalResult verifyNotInProceduralRegion(Operation *op) {
17 auto *parent = op;
18 while ((parent = parent->getParentOp())) {
19 if (parent->hasTrait<NonProceduralRegion>())
20 return success();
21 if (parent->hasTrait<ProceduralRegion>())
22 return op->emitOpError("must not be in a procedural region");
23 }
24 return success();
25}
26
27LogicalResult verifyNotInNonProceduralRegion(Operation *op) {
28 auto *parent = op;
29 while ((parent = parent->getParentOp())) {
30 if (parent->hasTrait<ProceduralRegion>())
31 return success();
32 if (parent->hasTrait<NonProceduralRegion>())
33 return op->emitOpError("must not be in a non-procedural region");
34 }
35 return success();
36}
37
38} // namespace circt
Signals that an operation's regions are non-procedural.
Signals that an operation's regions are procedural.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
LogicalResult verifyNotInNonProceduralRegion(Operation *op)
Returns success if the operation has no closer surrounding parent marked as non-procedural region tha...
LogicalResult verifyNotInProceduralRegion(Operation *op)
Returns success if the operation has no closer surrounding parent marked as procedural region than it...