Skip to content

Commit 27e1f2a

Browse files
authored
Merge pull request #1423 from janmroczkowski/janmroczkowski/fresh_symbol-reset_temporary_counter
Add reset_temporary_counter to fresh_symbol
2 parents 15af645 + eb5726e commit 27e1f2a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/util/fresh_symbol.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ Author: Chris Smowton, [email protected]
1111

1212
#include "fresh_symbol.h"
1313

14+
// This needs to be outside get_fresh_aux_symbol
15+
// to make it available for both reset_temporary_counter
16+
// and get_fresh_aux_symbol
17+
static size_t temporary_counter=0;
18+
19+
// This is useful with loading multiple GOTO models
20+
void reset_temporary_counter()
21+
{
22+
temporary_counter=0;
23+
}
24+
1425
/// Installs a fresh-named symbol with the requested name pattern
1526
/// \par parameters: `type`: type of new symbol
1627
/// `name_prefix`, `basename_prefix`: new symbol will be named
@@ -27,7 +38,6 @@ symbolt &get_fresh_aux_symbol(
2738
const irep_idt &symbol_mode,
2839
symbol_tablet &symbol_table)
2940
{
30-
static size_t temporary_counter=0;
3141
auxiliary_symbolt new_symbol;
3242
symbolt *symbol_ptr;
3343

src/util/fresh_symbol.h

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Author: Chris Smowton, [email protected]
1919
#include <util/symbol_table.h>
2020
#include <util/type.h>
2121

22+
void reset_temporary_counter();
23+
2224
symbolt &get_fresh_aux_symbol(
2325
const typet &type,
2426
const std::string &name_prefix,

0 commit comments

Comments
 (0)