Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/util/fresh_symbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ Author: Chris Smowton, [email protected]

#include "fresh_symbol.h"

// This needs to be outside get_fresh_aux_symbol
// to make it available for both reset_temporary_counter
// and get_fresh_aux_symbol
static size_t temporary_counter=0;

// This is useful with loading multiple GOTO models
void reset_temporary_counter()
{
temporary_counter=0;
}

/// Installs a fresh-named symbol with the requested name pattern
/// \par parameters: `type`: type of new symbol
/// `name_prefix`, `basename_prefix`: new symbol will be named
Expand All @@ -27,7 +38,6 @@ symbolt &get_fresh_aux_symbol(
const irep_idt &symbol_mode,
symbol_tablet &symbol_table)
{
static size_t temporary_counter=0;
auxiliary_symbolt new_symbol;
symbolt *symbol_ptr;

Expand Down
2 changes: 2 additions & 0 deletions src/util/fresh_symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Author: Chris Smowton, [email protected]
#include <util/symbol_table.h>
#include <util/type.h>

void reset_temporary_counter();

symbolt &get_fresh_aux_symbol(
const typet &type,
const std::string &name_prefix,
Expand Down