Skip to content

Commit eb5726e

Browse files
author
janmroczkowski
committed
Add reset_temporary_counter to fresh_symbol
1 parent 875d554 commit eb5726e

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/util/fresh_symbol.cpp

Lines changed: 11 additions & 1 deletion
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

Lines changed: 2 additions & 0 deletions
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)