Skip to content

Commit 0edafab

Browse files
author
Owen Jones
committed
Document $, !, @ and # in symbol names
Document what symbol name suffices beginning with $, !, @ and # mean, at the points in the code where they are created.
1 parent 0713f0e commit 0edafab

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/util/fresh_symbol.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ symbolt &get_fresh_aux_symbol(
4141

4242
do
4343
{
44+
// Distinguish local variables with the same name
4445
new_symbol.base_name=
4546
basename_prefix+
4647
"$"+

src/util/ssa_expr.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,23 @@ static void build_ssa_identifier_rec(
6161

6262
if(!l0.empty())
6363
{
64+
// Distinguish different threads of execution
6465
os << '!' << l0;
6566
l1_object_os << '!' << l0;
6667
}
6768

6869
if(!l1.empty())
6970
{
71+
// Distinguish different calls to the same function (~stack frame)
7072
os << '@' << l1;
7173
l1_object_os << '@' << l1;
7274
}
7375

7476
if(!l2.empty())
77+
{
78+
// Distinguish SSA steps for the same variable
7579
os << '#' << l2;
80+
}
7681
}
7782
else
7883
assert(false);

0 commit comments

Comments
 (0)