Skip to content

Commit fcd08de

Browse files
committed
Updates requested in the review:
- Added comment explaining the LVSA summary unload - Removal of obsolete logging - Fixed typos
1 parent 746cf0d commit fcd08de

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/taint-analysis/taint_summary.cpp

+13-1
Original file line numberDiff line numberDiff line change
@@ -1733,6 +1733,19 @@ void taint_summarise_all_functions(
17331733

17341734
auto start_time=std::chrono::high_resolution_clock::now();
17351735

1736+
// In the map 'lvsadb_flush_ref_counts' there we store for each function
1737+
// in the inverted topological order two information:
1738+
// - reference count (how many callers the function has)
1739+
// - names of the callees
1740+
// where both information are considered w.r.t. the inverted topological
1741+
// order. Namely, considered are only recursive calls to predecessors in the
1742+
// topological order.
1743+
// We use the map for unloading not needed LVSA summaries from the memory
1744+
// (but they are saved on the disk). An LVSA summary of a given function
1745+
// is not needed at a given position in the inverted topological order of
1746+
// functions, if none of the remaining function (i.e. those after the position
1747+
// in the order) is a caller of the given function w.r.t the inverted
1748+
// topological order.
17361749
typedef std::pair<std::size_t, std::unordered_set<irep_idt>>
17371750
refcount_and_calleest;
17381751
std::unordered_map<irep_idt, refcount_and_calleest> lvsadb_flush_ref_counts;
@@ -1845,7 +1858,6 @@ void taint_summarise_all_functions(
18451858
--elem.first;
18461859
if(elem.first == 0UL)
18471860
{
1848-
std::cout << "@@@ Trying to flush: " << succ << std::endl;
18491861
const bool unloaded = lvsa_db.unload(succ);
18501862
INVARIANT(unloaded || skipped.count(succ) != 0UL,
18511863
"Either the LVSA summary was unloaded or there was "

src/util/cached_map.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -514,10 +514,10 @@ class cached_mapt final
514514
Function: cached_mapt::unload(const key_type &)
515515
516516
Inputs:
517-
key: A key whose corresponding value should be unload.
517+
key: A key whose corresponding value should be unloaded.
518518
519519
Outputs:
520-
True, if the referenced element was unload, and false otherwise.
520+
True, if the referenced element was unloaded, and false otherwise.
521521
522522
Purpose:
523523
Unloads the element referenced by the passed key in the cache to allow the

0 commit comments

Comments
 (0)