1717#include " symbol.h"
1818#include " symbol_table_base.h"
1919
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
2122// / \param type: The type of the new symbol.
2223// / \param name_prefix: The new symbol will be named
2324// / `name_prefix::basename_prefix$num` unless name_prefix is empty, in which
2425// / case the :: prefix is omitted.
2526// / \param basename_prefix: See `name_prefix`.
2627// / \param source_location: The source location for the new symbol.
2728// / \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`
2830// / \param symbol_table: The symbol table to add the new symbol to.
2931// / \return The new symbol.
3032symbolt &get_fresh_aux_symbol (
@@ -33,9 +35,9 @@ symbolt &get_fresh_aux_symbol(
3335 const std::string &basename_prefix,
3436 const source_locationt &source_location,
3537 const irep_idt &symbol_mode,
38+ const namespacet &ns,
3639 symbol_table_baset &symbol_table)
3740{
38- namespacet ns (symbol_table);
3941 irep_idt identifier = basename_prefix;
4042 std::size_t prefix_size = 0 ;
4143 if (!name_prefix.empty ())
@@ -55,3 +57,32 @@ symbolt &get_fresh_aux_symbol(
5557
5658 return res.first ;
5759}
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