Skip to content

Commit 6822adb

Browse files
author
Remi Delmas
committed
CONTRACTS: use goto_programt::get_decl_identifiers
1 parent c6798d2 commit 6822adb

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/goto-instrument/contracts/cfg_info.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -202,18 +202,14 @@ class goto_program_cfg_infot : public cfg_infot
202202
explicit goto_program_cfg_infot(const goto_programt &goto_program)
203203
{
204204
// collect symbols declared in the insruction sequence as locals
205-
for(const auto &instruction : goto_program.instructions)
206-
{
207-
if(instruction.is_decl())
208-
locals.insert(instruction.decl_symbol().get_identifier());
209-
}
205+
goto_program.get_decl_identifiers(locals);
210206

211207
// collect dirty locals
212208
goto_functiont goto_function;
213209
goto_function.body.copy_from(goto_program);
214210

215211
dirtyt is_dirty(goto_function);
216-
auto dirty_ids = is_dirty.get_dirty_ids();
212+
const auto &dirty_ids = is_dirty.get_dirty_ids();
217213
dirty.insert(dirty_ids.begin(), dirty_ids.end());
218214
}
219215

@@ -234,8 +230,8 @@ class goto_program_cfg_infot : public cfg_infot
234230
}
235231

236232
protected:
237-
std::unordered_set<irep_idt> locals;
238-
std::unordered_set<irep_idt> dirty;
233+
std::set<irep_idt> locals;
234+
std::set<irep_idt> dirty;
239235
};
240236

241237
#endif

0 commit comments

Comments
 (0)