LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
SymbolTableLLZK.h
Go to the documentation of this file.
1//===-- SymbolTableLLZK.h ------------------------------------------*- 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// Adapted from the LLVM Project's mlir/include/mlir/IR/SymbolTable.h
9// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
10// See https://llvm.org/LICENSE.txt for license information.
11// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
12//
13//===----------------------------------------------------------------------===//
14
15#pragma once
16
17#include <mlir/IR/SymbolTable.h>
18
19namespace llzk {
20
25std::optional<mlir::SymbolTable::UseRange> getSymbolUses(mlir::Operation *from);
26std::optional<mlir::SymbolTable::UseRange> getSymbolUses(mlir::Region *from);
27
32std::optional<mlir::SymbolTable::UseRange>
33getSymbolUses(mlir::StringAttr symbol, mlir::Operation *from);
34std::optional<mlir::SymbolTable::UseRange>
35getSymbolUses(mlir::Operation *symbol, mlir::Operation *from);
36std::optional<mlir::SymbolTable::UseRange>
37getSymbolUses(mlir::StringAttr symbol, mlir::Region *from);
38std::optional<mlir::SymbolTable::UseRange>
39getSymbolUses(mlir::Operation *symbol, mlir::Region *from);
40
47bool symbolKnownUseEmpty(mlir::StringAttr symbol, mlir::Operation *from);
48bool symbolKnownUseEmpty(mlir::Operation *symbol, mlir::Operation *from);
49bool symbolKnownUseEmpty(mlir::StringAttr symbol, mlir::Region *from);
50bool symbolKnownUseEmpty(mlir::Operation *symbol, mlir::Region *from);
51
53mlir::StringAttr getSymbolName(mlir::Operation *symbol);
54inline mlir::StringAttr getSymbolName(mlir::SymbolOpInterface symbol) {
55 return getSymbolName(symbol.getOperation());
56}
57
58} // namespace llzk
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation and configuration files Object form shall mean any form resulting from mechanical transformation or translation of a Source including but not limited to compiled object generated and conversions to other media types Work shall mean the work of whether in Source or Object made available under the as indicated by a copyright notice that is included in or attached to the whether in Source or Object that is based or other modifications as a an original work of authorship For the purposes of this Derivative Works shall not include works that remain separable from
Definition LICENSE.txt:45
std::optional< mlir::SymbolTable::UseRange > getSymbolUses(mlir::Operation *from)
Get an iterator range for all of the uses, for any symbol, that are nested within the given operation...
mlir::StringAttr getSymbolName(mlir::Operation *symbol)
Returns the name of the given symbol operation, or nullptr if no symbol is present.
bool symbolKnownUseEmpty(mlir::StringAttr symbol, mlir::Operation *from)
Return if the given symbol is known to have no uses that are nested within the given operation 'from'...