@@ -122,40 +122,21 @@ void call_grapht::output_xml(std::ostream &out) const
122
122
}
123
123
}
124
124
125
- /* ******************************************************************\
126
-
127
- Function: call_grapht::out_edges
128
-
129
- Inputs: `caller`: node to search for
130
-
131
- Outputs: Returns list of edges whose first component is `caller`.
132
-
133
- Purpose:
134
-
135
- \*******************************************************************/
136
-
125
+ // / \par parameters: `caller`: node to search for
126
+ // / \return Returns list of edges whose first component is `caller`.
137
127
call_grapht::call_edges_ranget
138
128
call_grapht::out_edges (const irep_idt &caller) const
139
129
{
140
130
return graph.equal_range (caller);
141
131
}
142
132
143
- /* ******************************************************************\
144
-
145
- Function: inverted_partial_topological_order
146
-
147
- Inputs: `call_graph`: Call graph
148
- `start_function`: start node, must occur in call graph
149
- `processed_functions`: set of functions already seen
150
-
151
- Outputs: `output`: inverted topological sort of the graph reachable
152
- from start node (i.e. leaves first, root last)
153
- `processed_functions`: set of functions already seen
154
-
155
- Purpose: Get reverse-top-sorted subgraph
156
-
157
- \*******************************************************************/
158
-
133
+ // / Get reverse-top-sorted subgraph
134
+ // / \par parameters: `call_graph`: Call graph
135
+ // / `start_function`: start node, must occur in call graph
136
+ // / `processed_functions`: set of functions already seen
137
+ // / \return `output`: inverted topological sort of the graph reachable from
138
+ // / start node (i.e. leaves first, root last) `processed_functions`: set of
139
+ // / functions already seen
159
140
void inverted_partial_topological_order (
160
141
const call_grapht &call_graph,
161
142
const irep_idt &start_function,
@@ -176,22 +157,12 @@ void inverted_partial_topological_order(
176
157
output.push_back (start_function);
177
158
}
178
159
179
- /* ******************************************************************\
180
-
181
- Function: get_inverted_topological_order
182
-
183
- Inputs: `call_graph`: Call graph
184
- `functions`: map containing all functions of interest;
185
- only function names are used to index into call graph;
186
- function bodies are ignored.
187
-
188
- Outputs: `output`: inverted topological sort of the graph reachable
189
- from start node (i.e. leaves first, root last)
190
-
191
- Purpose: Get reverse-top-sorted call graph
192
-
193
- \*******************************************************************/
194
-
160
+ // / Get reverse-top-sorted call graph
161
+ // / \par parameters: `call_graph`: Call graph
162
+ // / `functions`: map containing all functions of interest; only function names
163
+ // / are used to index into call graph; function bodies are ignored.
164
+ // / \return `output`: inverted topological sort of the graph reachable from
165
+ // / start node (i.e. leaves first, root last)
195
166
void get_inverted_topological_order (
196
167
const call_grapht& call_graph,
197
168
const goto_functionst& functions,
@@ -206,21 +177,11 @@ void get_inverted_topological_order(
206
177
output);
207
178
}
208
179
209
- /* ******************************************************************\
210
-
211
- Function: exists_direct_call
212
-
213
- Inputs: `call_graph`: Call graph
214
- `caller`: Caller
215
- `callee`: Potential callee
216
-
217
- Outputs: Returns true if call graph says caller calls callee.
218
-
219
- Purpose: See output
220
-
221
- \*******************************************************************/
222
-
223
-
180
+ // / See output
181
+ // / \par parameters: `call_graph`: Call graph
182
+ // / `caller`: Caller
183
+ // / `callee`: Potential callee
184
+ // / \return Returns true if call graph says caller calls callee.
224
185
bool exists_direct_call (
225
186
const call_grapht &call_graph,
226
187
const irep_idt &caller,
@@ -234,24 +195,14 @@ bool exists_direct_call(
234
195
return false ;
235
196
}
236
197
237
- /* ******************************************************************\
238
-
239
- Function: exists_direct_or_indirect_call
240
-
241
- Inputs: `call_graph`: Call graph
242
- `caller`: Caller
243
- `callee`: Potential callee
244
- `ignored_functions`: Functions to exclude from call graph
245
- for the purposes of finding a path
246
-
247
- Outputs: Returns true if call graph says caller can reach callee
248
- via any intermediate sequence of callees not occurring
249
- in ignored_functions
250
-
251
- Purpose: See output
252
-
253
- \*******************************************************************/
254
-
198
+ // / See output
199
+ // / \par parameters: `call_graph`: Call graph
200
+ // / `caller`: Caller
201
+ // / `callee`: Potential callee
202
+ // / `ignored_functions`: Functions to exclude from call graph for the purposes
203
+ // / of finding a path
204
+ // / \return Returns true if call graph says caller can reach callee via any
205
+ // / intermediate sequence of callees not occurring in ignored_functions
255
206
bool exists_direct_or_indirect_call (
256
207
const call_grapht &call_graph,
257
208
const irep_idt &caller,
@@ -275,21 +226,12 @@ bool exists_direct_or_indirect_call(
275
226
return false ;
276
227
}
277
228
278
- /* ******************************************************************\
279
-
280
- Function: exists_direct_or_indirect_call
281
-
282
- Inputs: `call_graph`: Call graph
283
- `caller`: Caller
284
- `callee`: Potential callee
285
-
286
- Outputs: Returns true if call graph says caller can reach callee
287
- via any intermediate sequence of callees
288
-
289
- Purpose: See output
290
-
291
- \*******************************************************************/
292
-
229
+ // / See output
230
+ // / \par parameters: `call_graph`: Call graph
231
+ // / `caller`: Caller
232
+ // / `callee`: Potential callee
233
+ // / \return Returns true if call graph says caller can reach callee via any
234
+ // / intermediate sequence of callees
293
235
bool exists_direct_or_indirect_call (
294
236
const call_grapht &call_graph,
295
237
const irep_idt &caller,
@@ -299,19 +241,10 @@ bool exists_direct_or_indirect_call(
299
241
return exists_direct_or_indirect_call (call_graph, caller, callee, ignored);
300
242
}
301
243
302
- /* ******************************************************************\
303
-
304
- Function: computed_inverted_call_graph
305
-
306
- Inputs: `original_call_graph`: call graph
307
-
308
- Outputs: `output_inverted_call_graph`: input call graph with caller->
309
- callee edges reversed.
310
-
311
- Purpose: See output
312
-
313
- \*******************************************************************/
314
-
244
+ // / See output
245
+ // / \par parameters: `original_call_graph`: call graph
246
+ // / \return `output_inverted_call_graph`: input call graph with caller-> callee
247
+ // / edges reversed.
315
248
void compute_inverted_call_graph (
316
249
const call_grapht &original_call_graph,
317
250
call_grapht &output_inverted_call_graph)
@@ -324,23 +257,12 @@ void compute_inverted_call_graph(
324
257
{elem.first , elem.second }));
325
258
}
326
259
327
- /* ******************************************************************\
328
-
329
- Function: find_leaves_below_function
330
-
331
- Inputs: `call_graph`: call graph
332
- `function`: start node
333
- `to_avoid`: functions already visited
334
-
335
- Outputs: `output`: set of leaves reachable from 'function'
336
- `to_avoid`: functions already visited (with 'function'
337
- added)
338
-
339
- Purpose: See output
340
-
341
- \*******************************************************************/
342
-
343
-
260
+ // / See output
261
+ // / \par parameters: `call_graph`: call graph
262
+ // / `function`: start node
263
+ // / `to_avoid`: functions already visited
264
+ // / \return `output`: set of leaves reachable from 'function' `to_avoid`:
265
+ // / functions already visited (with 'function' added)
344
266
void find_leaves_below_function (
345
267
const call_grapht &call_graph,
346
268
const irep_idt &function,
@@ -361,19 +283,10 @@ void find_leaves_below_function(
361
283
}
362
284
}
363
285
364
- /* ******************************************************************\
365
-
366
- Function: find_leaves_below_function
367
-
368
- Inputs: `call_graph`: call graph
369
- `function`: start node
370
-
371
- Outputs: `output`: set of leaves reachable from 'function'
372
-
373
- Purpose: See output
374
-
375
- \*******************************************************************/
376
-
286
+ // / See output
287
+ // / \par parameters: `call_graph`: call graph
288
+ // / `function`: start node
289
+ // / \return `output`: set of leaves reachable from 'function'
377
290
void find_leaves_below_function (
378
291
const call_grapht &call_graph,
379
292
const irep_idt &function,
0 commit comments