CIRCT 20.0.0git
Loading...
Searching...
No Matches
Utils.h
Go to the documentation of this file.
1//===- Utils.h - Miscellaneous utilities ----------------------------------===//
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// Miscellaneous utilities for CIRCT that do not fit in with other files.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef CIRCT_SUPPORT_UTILS_H
14#define CIRCT_SUPPORT_UTILS_H
15
16#include "circt/Support/LLVM.h"
17#include "mlir/IR/Operation.h"
18#include "mlir/IR/Value.h"
19
20namespace circt {
21/// Return true if a Value is created "underneath" an operation. This is
22/// frequently useful when negated as that indicates that a Value is defined
23/// "outside" the region of an Operation and that the Operation is thereby
24/// "capturing" the value.
25inline bool isAncestorOfValueOwner(Operation *op, Value value) {
26 return op->isAncestor(value.getParentBlock()->getParentOp());
27}
28} // namespace circt
29
30#endif // CIRCT_SUPPORT_UTILS_H
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
bool isAncestorOfValueOwner(Operation *op, Value value)
Return true if a Value is created "underneath" an operation.
Definition Utils.h:25