CIRCT  20.0.0git
FieldRef.cpp
Go to the documentation of this file.
1 //===- FieldRef.cpp - Field Refs -------------------------------*- 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 // This header file defines FieldRef and helpers for them.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "circt/Support/FieldRef.h"
14 #include "mlir/IR/Block.h"
15 #include "mlir/IR/Value.h"
16 
17 using namespace circt;
18 
19 Operation *FieldRef::getDefiningOp() const {
20  if (auto *op = value.getDefiningOp())
21  return op;
22  return cast<BlockArgument>(value).getOwner()->getParentOp();
23 }
Operation * getDefiningOp() const
Get the operation which defines this field.
Definition: FieldRef.cpp:19
Value value
A pointer to the value which created this.
Definition: FieldRef.h:85
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition: DebugAnalysis.h:21