LLZK 2.1.1
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
SymbolUseGraphPass.cpp
Go to the documentation of this file.
1//===-- SymbolUseGraphPass.cpp ----------------------------------*- C++ -*-===//
2//
3// Part of the LLZK Project, under the Apache License v2.0.
4// See LICENSE.txt for license information.
5// Copyright 2025 Veridise Inc.
6// SPDX-License-Identifier: Apache-2.0
7//
8//===----------------------------------------------------------------------===//
13//===----------------------------------------------------------------------===//
14
17
18namespace llzk {
19#define GEN_PASS_DEF_SYMBOLUSEGRAPHPRINTERPASS
21} // namespace llzk
22
23namespace {
24
25using namespace llzk;
26
27class PassImpl : public llzk::impl::SymbolUseGraphPrinterPassBase<PassImpl> {
28 using Base = SymbolUseGraphPrinterPassBase<PassImpl>;
29 using Base::Base;
30
31 void runOnOperation() override {
32 markAllAnalysesPreserved();
33
34 SymbolUseGraph &a = getAnalysis<SymbolUseGraph>();
35 if (saveDotGraph) {
36 a.dumpToDotFile();
37 }
38 a.print(toStream(outputStream));
39 }
40};
41
42} // namespace
void dumpToDotFile(std::string filename="") const
Dump the graph to file in dot graph format.
void print(llvm::raw_ostream &os) const
llvm::raw_ostream & toStream(OutputStream val)