17
17
#include " symbol.h"
18
18
#include " symbol_table_base.h"
19
19
20
- // / Installs a fresh-named symbol with the requested name pattern.
20
+ // / Installs a fresh-named symbol with respect to the given namespace `ns` with
21
+ // / the requested name pattern in the given symbol table
21
22
// / \param type: The type of the new symbol.
22
23
// / \param name_prefix: The new symbol will be named
23
24
// / `name_prefix::basename_prefix$num` unless name_prefix is empty, in which
24
25
// / case the :: prefix is omitted.
25
26
// / \param basename_prefix: See `name_prefix`.
26
27
// / \param source_location: The source location for the new symbol.
27
28
// / \param symbol_mode: The mode for the new symbol, e.g. ID_C, ID_java.
29
+ // / \param ns: the new symbol has a different name than any symbols in `ns`
28
30
// / \param symbol_table: The symbol table to add the new symbol to.
29
31
// / \return The new symbol.
30
32
symbolt &get_fresh_aux_symbol (
@@ -33,9 +35,9 @@ symbolt &get_fresh_aux_symbol(
33
35
const std::string &basename_prefix,
34
36
const source_locationt &source_location,
35
37
const irep_idt &symbol_mode,
38
+ const namespacet &ns,
36
39
symbol_table_baset &symbol_table)
37
40
{
38
- namespacet ns (symbol_table);
39
41
irep_idt identifier = basename_prefix;
40
42
std::size_t prefix_size = 0 ;
41
43
if (!name_prefix.empty ())
@@ -55,3 +57,32 @@ symbolt &get_fresh_aux_symbol(
55
57
56
58
return res.first ;
57
59
}
60
+
61
+ // / Installs a fresh-named symbol with the requested name pattern in the given
62
+ // / symbol table
63
+ // / \param type: The type of the new symbol.
64
+ // / \param name_prefix: The new symbol will be named
65
+ // / `name_prefix::basename_prefix$num` unless name_prefix is empty, in which
66
+ // / case the :: prefix is omitted.
67
+ // / \param basename_prefix: See `name_prefix`.
68
+ // / \param source_location: The source location for the new symbol.
69
+ // / \param symbol_mode: The mode for the new symbol, e.g. ID_C, ID_java.
70
+ // / \param symbol_table: The symbol table to add the new symbol to.
71
+ // / \return The new symbol.
72
+ symbolt &get_fresh_aux_symbol (
73
+ const typet &type,
74
+ const std::string &name_prefix,
75
+ const std::string &basename_prefix,
76
+ const source_locationt &source_location,
77
+ const irep_idt &symbol_mode,
78
+ symbol_table_baset &symbol_table)
79
+ {
80
+ return get_fresh_aux_symbol (
81
+ type,
82
+ name_prefix,
83
+ basename_prefix,
84
+ source_location,
85
+ symbol_mode,
86
+ namespacet (symbol_table),
87
+ symbol_table);
88
+ }
0 commit comments