Skip to content

Commit d2abadb

Browse files
committed
Revert "Store "is hidden" attribute of goto functions in the symbol table"
This reverts commit ebfab8d.
1 parent 16ed35a commit d2abadb

File tree

8 files changed

+5
-32
lines changed

8 files changed

+5
-32
lines changed

src/goto-instrument/cover_filter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ bool internal_functions_filtert::operator()(
2929
if(function.name == INITIALIZE_FUNCTION)
3030
return false;
3131

32-
if(function.is_hidden())
32+
if(goto_function.is_hidden())
3333
return false;
3434

3535
// ignore Java built-ins (synthetic functions)

src/goto-programs/goto_convert_functions.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,7 @@ void goto_convert_functionst::convert_function(
226226
f.body.update();
227227

228228
if(hide(f.body))
229-
{
230229
f.make_hidden();
231-
symbol_table.get_writeable_ref(identifier).set_hidden();
232-
}
233230

234231
lifetime = parent_lifetime;
235232
}

src/goto-programs/goto_inline_class.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ void goto_inlinet::insert_function_body(
256256
end.type=LOCATION;
257257

258258
// make sure the inlined function does not introduce hiding
259-
if(ns.lookup(identifier).is_hidden())
259+
if(goto_function.is_hidden())
260260
{
261261
for(auto &instruction : body.instructions)
262262
instruction.labels.remove(CPROVER_PREFIX "HIDE");

src/goto-programs/read_bin_goto_object.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,7 @@ static bool read_bin_goto_object(
160160
f.body.update();
161161

162162
if(hidden)
163-
{
164163
f.make_hidden();
165-
// can be removed with the next goto-binary version update as the
166-
// information is guaranteed to be stored in the symbol table
167-
#if GOTO_BINARY_VERSION > 5
168-
#error This code should be removed
169-
#endif
170-
symbol_table.get_writeable_ref(fname).set_hidden();
171-
}
172164
}
173165

174166
functions.compute_location_numbers();

src/goto-symex/symex_function_call.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,8 @@ void goto_symext::symex_function_call_code(
270270
[&](const exprt &a) { return state.rename(a, ns); });
271271

272272
// we hide the call if the caller and callee are both hidden
273-
const bool callee_is_hidden = ns.lookup(identifier).is_hidden();
274273
const bool hidden =
275-
state.call_stack().top().hidden_function && callee_is_hidden;
274+
state.call_stack().top().hidden_function && goto_function.is_hidden();
276275

277276
// record the call
278277
target.function_call(
@@ -338,7 +337,7 @@ void goto_symext::symex_function_call_code(
338337
frame.end_of_function=--goto_function.body.instructions.end();
339338
frame.return_value=call.lhs();
340339
frame.function_identifier=identifier;
341-
frame.hidden_function = callee_is_hidden;
340+
frame.hidden_function = goto_function.is_hidden();
342341

343342
const framet &p_frame = state.call_stack().previous_frame();
344343
for(const auto &pair : p_frame.loop_iterations)

src/goto-symex/symex_main.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,7 @@ std::unique_ptr<goto_symext::statet> goto_symext::initialize_entry_point_state(
434434
state->call_stack().top().end_of_function = limit;
435435
state->call_stack().top().calling_location.pc =
436436
state->call_stack().top().end_of_function;
437-
state->call_stack().top().hidden_function =
438-
ns.lookup(entry_point_id).is_hidden();
437+
state->call_stack().top().hidden_function = start_function->is_hidden();
439438

440439
state->symex_target = &target;
441440

src/util/symbol.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,6 @@ class symbolt
117117
value = exprt(ID_compiled);
118118
}
119119

120-
/// Returns true iff the symbol is marked for internal use.
121-
bool is_hidden() const
122-
{
123-
return is_auxiliary;
124-
}
125-
126-
/// Mark a symbol for internal use. This is advisory and may be utilized,
127-
/// e.g., to filter output.
128-
void set_hidden()
129-
{
130-
is_auxiliary = true;
131-
}
132-
133120
/// Check that a symbol is well formed.
134121
bool is_well_formed() const;
135122

unit/goto-instrument/cover/cover_only.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ symbolt create_new_symbol(const irep_idt &name, const irep_idt &file_name)
2222
source_locationt location;
2323
location.set_file(file_name);
2424
symbol.location = location;
25-
symbol.type = code_typet{{}, empty_typet{}};
2625

2726
return symbol;
2827
}

0 commit comments

Comments
 (0)