CIRCT  18.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 value.cast<BlockArgument>().getOwner()->getParentOp();
23 }
24 
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
This file defines an intermediate representation for circuits acting as an abstraction for constraint...
Definition: DebugAnalysis.h:21