Skip to content

Commit b0cd57b

Browse files
Encapsulate lazy_goto_modelt::goto_functions
1 parent ef02f4d commit b0cd57b

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

src/goto-programs/goto_model.h

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ class goto_modelt
6363
goto_functions=std::move(other.goto_functions);
6464
return *this;
6565
}
66+
67+
void unload(const irep_idt &name) { goto_functions.unload(name); }
6668
};
6769

6870
#endif // CPROVER_GOTO_PROGRAMS_GOTO_MODEL_H

src/goto-programs/lazy_goto_model.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void lazy_goto_modelt::initialize(const cmdlinet &cmdline)
100100
throw 0;
101101
}
102102

103-
language_filet &lf=language_files.add_file(filename);
103+
language_filet &lf=add_language_file(filename);
104104
lf.language=get_language_from_filename(filename);
105105

106106
if(lf.language==nullptr)

src/goto-programs/lazy_goto_model.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ class lazy_goto_modelt
7171
/// Eagerly loads all functions from the symbol table.
7272
void load_all_functions() const;
7373

74+
void unload(const irep_idt &name) const { goto_functions.unload(name); }
75+
7476
language_filet &add_language_file(const std::string &filename)
7577
{
7678
return language_files.add_file(filename);
@@ -96,9 +98,9 @@ class lazy_goto_modelt
9698
public:
9799
/// Reference to symbol_table in the internal goto_model
98100
symbol_tablet &symbol_table;
99-
const lazy_goto_functions_mapt<goto_programt> goto_functions;
100101

101102
private:
103+
const lazy_goto_functions_mapt<goto_programt> goto_functions;
102104
language_filest language_files;
103105

104106
// Function/module processing functions

src/goto-programs/rebuild_goto_start_function.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ bool rebuild_goto_start_function_baset<goto_modelt>::operator()()
6262
// Remove the function from the goto functions so it is copied back in
6363
// from the symbol table during goto_convert
6464
if(!return_code)
65-
goto_model.goto_functions.unload(goto_functionst::entry_point());
65+
goto_model.unload(goto_functionst::entry_point());
6666

6767
return return_code;
6868
}

0 commit comments

Comments
 (0)