Skip to content

Commit

Permalink
Merge pull request diffblue#1499 from smowton/smowton/feature/vsa_tak…
Browse files Browse the repository at this point in the history
…e_two

Templatize value-set analysis
  • Loading branch information
tautschnig authored Nov 26, 2017
2 parents 386a3bc + 6ebceca commit 02e7b4a
Show file tree
Hide file tree
Showing 12 changed files with 707 additions and 60 deletions.
1 change: 0 additions & 1 deletion src/pointer-analysis/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ SRC = add_failed_symbols.cpp \
value_set_analysis_fivr.cpp \
value_set_analysis_fivrns.cpp \
value_set_dereference.cpp \
value_set_domain.cpp \
value_set_domain_fi.cpp \
value_set_domain_fivr.cpp \
value_set_domain_fivrns.cpp \
Expand Down
2 changes: 1 addition & 1 deletion src/pointer-analysis/show_value_sets.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ Author: Daniel Kroening, [email protected]
#ifndef CPROVER_POINTER_ANALYSIS_SHOW_VALUE_SETS_H
#define CPROVER_POINTER_ANALYSIS_SHOW_VALUE_SETS_H

#include <pointer-analysis/value_set_analysis.h>
#include <util/ui_message.h>

class goto_modelt;
class value_set_analysist;

void show_value_sets(
ui_message_handlert::uit,
Expand Down
17 changes: 15 additions & 2 deletions src/pointer-analysis/value_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ Author: Daniel Kroening, [email protected]

#include "add_failed_symbols.h"

// Due to a large number of functions defined inline, `value_sett` and
// associated types are documented in its header file, `value_set.h`.

const value_sett::object_map_dt value_sett::object_map_dt::blank{};
object_numberingt value_sett::object_numbering;

Expand Down Expand Up @@ -1205,6 +1208,12 @@ void value_sett::assign(
object_mapt values_rhs;
get_value_set(rhs, values_rhs, ns, is_simplified);

// Permit custom subclass to alter the read values prior to write:
adjust_assign_rhs_values(rhs, ns, values_rhs);

// Permit custom subclass to perform global side-effects prior to write:
apply_assign_side_effects(lhs, rhs, ns);

assign_rec(lhs, values_rhs, "", ns, add_to_sets);
}
}
Expand Down Expand Up @@ -1484,7 +1493,7 @@ void value_sett::do_end_function(
assign(lhs, rhs, ns, false, false);
}

void value_sett::apply_code(
void value_sett::apply_code_rec(
const codet &code,
const namespacet &ns)
{
Expand All @@ -1493,7 +1502,7 @@ void value_sett::apply_code(
if(statement==ID_block)
{
forall_operands(it, code)
apply_code(to_code(*it), ns);
apply_code_rec(to_code(*it), ns);
}
else if(statement==ID_function_call)
{
Expand Down Expand Up @@ -1611,6 +1620,10 @@ void value_sett::apply_code(
{
// doesn't do anything
}
else if(statement==ID_dead)
{
// Ignore by default; could prune the value set.
}
else
{
// std::cerr << code.pretty() << '\n';
Expand Down
Loading

0 comments on commit 02e7b4a

Please sign in to comment.