CIRCT 20.0.0git
Loading...
Searching...
No Matches
SymCache.cpp
Go to the documentation of this file.
1//===- SymCache.cpp - Declare Symbol Cache ----------------------*- 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 file defines a Symbol Cache.
10//
11//===----------------------------------------------------------------------===//
12
14
15using namespace mlir;
16using namespace circt;
17
18namespace circt {
19
20/// Virtual method anchor.
22
23void SymbolCacheBase::addDefinitions(mlir::Operation *top) {
24 for (auto &region : top->getRegions())
25 for (auto &block : region.getBlocks())
26 for (auto symOp : block.getOps<mlir::SymbolOpInterface>())
27 addSymbol(symOp);
28}
29} // namespace circt
void addDefinitions(mlir::Operation *top)
Populate the symbol cache with all symbol-defining operations within the 'top' operation.
Definition SymCache.cpp:23
void addSymbol(mlir::SymbolOpInterface op)
Adds the symbol-defining 'op' to the cache.
Definition SymCache.h:33
virtual ~SymbolCacheBase()
Virtual method anchor.
Definition SymCache.cpp:21
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.