CIRCT  20.0.0git
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 
13 #include "circt/Support/SymCache.h"
14 
15 using namespace mlir;
16 using namespace circt;
17 
18 namespace circt {
19 
20 /// Virtual method anchor.
21 SymbolCacheBase::~SymbolCacheBase() {}
22 
23 void 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
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition: DebugAnalysis.h:21