@@ -137,47 +137,47 @@ class SymbolTable {
137
137
138
138
// / Get an iterator range for all of the uses, for any symbol, that are nested
139
139
// / within the given operation 'from'. This does not traverse into any nested
140
- // / symbol tables, and will also only return uses on 'from' if it does not
141
- // / also define a symbol table. This is because we treat the region as the
142
- // / boundary of the symbol table, and not the op itself. This function returns
143
- // / None if there are any unknown operations that may potentially be symbol
144
- // / tables.
140
+ // / symbol tables. This function returns None if there are any unknown
141
+ // / operations that may potentially be symbol tables.
145
142
static Optional<UseRange> getSymbolUses (Operation *from);
143
+ static Optional<UseRange> getSymbolUses (Region *from);
146
144
147
145
// / Get all of the uses of the given symbol that are nested within the given
148
- // / operation 'from'. This does not traverse into any nested symbol tables,
149
- // / and will also only return uses on 'from' if it does not also define a
150
- // / symbol table. This is because we treat the region as the boundary of the
151
- // / symbol table, and not the op itself. This function returns None if there
152
- // / are any unknown operations that may potentially be symbol tables.
146
+ // / operation 'from'. This does not traverse into any nested symbol tables.
147
+ // / This function returns None if there are any unknown operations that may
148
+ // / potentially be symbol tables.
153
149
static Optional<UseRange> getSymbolUses (StringRef symbol, Operation *from);
154
150
static Optional<UseRange> getSymbolUses (Operation *symbol, Operation *from);
151
+ static Optional<UseRange> getSymbolUses (StringRef symbol, Region *from);
152
+ static Optional<UseRange> getSymbolUses (Operation *symbol, Region *from);
155
153
156
154
// / Return if the given symbol is known to have no uses that are nested
157
155
// / within the given operation 'from'. This does not traverse into any nested
158
- // / symbol tables, and will also only count uses on 'from' if it does not also
159
- // / define a symbol table. This is because we treat the region as the boundary
160
- // / of the symbol table, and not the op itself. This function will also return
161
- // / false if there are any unknown operations that may potentially be symbol
162
- // / tables. This doesn't necessarily mean that there are no uses, we just
163
- // / can't conservatively prove it.
156
+ // / symbol tables. This function will also return false if there are any
157
+ // / unknown operations that may potentially be symbol tables. This doesn't
158
+ // / necessarily mean that there are no uses, we just can't conservatively
159
+ // / prove it.
164
160
static bool symbolKnownUseEmpty (StringRef symbol, Operation *from);
165
161
static bool symbolKnownUseEmpty (Operation *symbol, Operation *from);
162
+ static bool symbolKnownUseEmpty (StringRef symbol, Region *from);
163
+ static bool symbolKnownUseEmpty (Operation *symbol, Region *from);
166
164
167
165
// / Attempt to replace all uses of the given symbol 'oldSymbol' with the
168
166
// / provided symbol 'newSymbol' that are nested within the given operation
169
- // / 'from'. This does not traverse into any nested symbol tables, and will
170
- // / also only replace uses on 'from' if it does not also define a symbol
171
- // / table. This is because we treat the region as the boundary of the symbol
172
- // / table, and not the op itself. If there are any unknown operations that may
173
- // / potentially be symbol tables, no uses are replaced and failure is
174
- // / returned.
167
+ // / 'from'. This does not traverse into any nested symbol tables. If there are
168
+ // / any unknown operations that may potentially be symbol tables, no uses are
169
+ // / replaced and failure is returned.
175
170
LLVM_NODISCARD static LogicalResult replaceAllSymbolUses (StringRef oldSymbol,
176
171
StringRef newSymbol,
177
172
Operation *from);
178
173
LLVM_NODISCARD static LogicalResult
179
174
replaceAllSymbolUses (Operation *oldSymbol, StringRef newSymbolName,
180
175
Operation *from);
176
+ LLVM_NODISCARD static LogicalResult
177
+ replaceAllSymbolUses (StringRef oldSymbol, StringRef newSymbol, Region *from);
178
+ LLVM_NODISCARD static LogicalResult
179
+ replaceAllSymbolUses (Operation *oldSymbol, StringRef newSymbolName,
180
+ Region *from);
181
181
182
182
private:
183
183
Operation *symbolTableOp;
0 commit comments