@@ -23,10 +23,9 @@ Author: Peter Schrammel
2323#include < util/ssa_expr.h>
2424#include < util/std_expr.h>
2525
26+ #include < langapi/language_util.h>
2627#include < solvers/flattening/boolbv_width.h>
2728
28- // TODO: change DEBUG_SM to DEBUG_SHADOW_MEMORY (it also appears in other files)
29-
3029irep_idt extract_field_name (const exprt &string_expr)
3130{
3231 if (can_cast_expr<typecast_exprt>(string_expr))
@@ -125,7 +124,7 @@ void log_value_set(
125124 const messaget &log,
126125 const std::vector<exprt> &value_set)
127126{
128- #ifdef DEBUG_SM
127+ #ifdef DEBUG_SHADOW_MEMORY
129128 log.conditional_output (
130129 log.debug (), [ns, value_set](messaget::mstreamt &mstream) {
131130 for (const auto &e : value_set)
@@ -145,7 +144,7 @@ void log_value_set_match(
145144 const exprt &expr,
146145 const value_set_dereferencet::valuet &shadow_dereference)
147146{
148- #ifdef DEBUG_SM
147+ #ifdef DEBUG_SHADOW_MEMORY
149148 log.conditional_output (
150149 log.debug (),
151150 [ns,
@@ -174,7 +173,7 @@ void log_value_set_match(
174173 const exprt &expr)
175174{
176175 // Leave guards rename to DEBUG_SHADOW_MEMORY
177- #ifdef DEBUG_SM
176+ #ifdef DEBUG_SHADOW_MEMORY
178177 log.conditional_output (
179178 log.debug (), [ns, address, expr](messaget::mstreamt &mstream) {
180179 mstream << " Shadow memory: value_set_match: " << format (address)
@@ -188,7 +187,7 @@ void log_try_shadow_address(
188187 const messaget &log,
189188 const shadow_memory_statet::shadowed_addresst &shadowed_address)
190189{
191- #ifdef DEBUG_SM
190+ #ifdef DEBUG_SHADOW_MEMORY
192191 log.conditional_output (
193192 log.debug (), [ns, shadowed_address](messaget::mstreamt &mstream) {
194193 mstream << " Shadow memory: trying shadowed address: "
@@ -203,7 +202,7 @@ void log_cond(
203202 const char *cond_text,
204203 const exprt &cond)
205204{
206- #ifdef DEBUG_SM
205+ #ifdef DEBUG_SHADOW_MEMORY
207206 log.conditional_output (
208207 log.debug (), [ns, cond_text, cond](messaget::mstreamt &mstream) {
209208 mstream << " Shadow memory: " << cond_text << " : " << format (cond)
@@ -218,7 +217,7 @@ static void log_are_types_incompatible(
218217 const shadow_memory_statet::shadowed_addresst &shadowed_address,
219218 const messaget &log)
220219{
221- #ifdef DEBUG_SM
220+ #ifdef DEBUG_SHADOW_MEMORY
222221 log.debug () << " Shadow memory: incompatible types "
223222 << from_type (ns, " " , expr.type ()) << " , "
224223 << from_type (ns, " " , shadowed_address.address .type ())
@@ -718,7 +717,7 @@ static value_set_dereferencet::valuet get_shadow_dereference(
718717 shadowed_object.object () = shadow;
719718 value_set_dereferencet::valuet shadow_dereference =
720719 value_set_dereferencet::build_reference_to (shadowed_object, expr, ns);
721- #ifdef DEBUG_SM
720+ #ifdef DEBUG_SHADOW_MEMORY
722721 log.debug () << " Shadow memory: shadow-deref: "
723722 << format (shadow_dereference.value ) << messaget::eom;
724723#endif
@@ -842,7 +841,7 @@ std::vector<std::pair<exprt, exprt>> get_shadow_dereference_candidates(
842841
843842 if (base_cond.is_true () && expr_cond.is_true ())
844843 {
845- #ifdef DEBUG_SM
844+ #ifdef DEBUG_SHADOW_MEMORY
846845 log.debug () << " exact match" << messaget::eom;
847846#endif
848847 exact_match = true ;
@@ -855,7 +854,7 @@ std::vector<std::pair<exprt, exprt>> get_shadow_dereference_candidates(
855854 {
856855 // No point looking at further shadow addresses
857856 // as only one of them can match.
858- #ifdef DEBUG_SM
857+ #ifdef DEBUG_SHADOW_MEMORY
859858 log.debug () << " base match" << messaget::eom;
860859#endif
861860 result.clear ();
@@ -864,7 +863,7 @@ std::vector<std::pair<exprt, exprt>> get_shadow_dereference_candidates(
864863 }
865864 else
866865 {
867- #ifdef DEBUG_SM
866+ #ifdef DEBUG_SHADOW_MEMORY
868867 log.debug () << " conditional match" << messaget::eom;
869868#endif
870869 result.emplace_back (and_exprt (base_cond, expr_cond), value);
@@ -932,7 +931,7 @@ bool check_value_set_contains_only_null_ptr(
932931 if (value_set.size () == 1 && contains_null_or_invalid (value_set, null_pointer))
933932 {
934933 // TODO: duplicated in log_value_set_match
935- #ifdef DEBUG_SM
934+ #ifdef DEBUG_SHADOW_MEMORY
936935 log.conditional_output (
937936 log.debug (), [ns, null_pointer, expr](messaget::mstreamt &mstream) {
938937 mstream << " Shadow memory: value set match: " << format (null_pointer)
@@ -963,7 +962,7 @@ get_shadow_memory_for_matched_object(
963962
964963 if (!are_types_compatible (expr.type (), shadowed_address.address .type ()))
965964 {
966- #ifdef DEBUG_SM
965+ #ifdef DEBUG_SHADOW_MEMORY
967966 log.debug () << " Shadow memory: incompatible types "
968967 << from_type (ns, " " , expr.type ()) << " , "
969968 << from_type (ns, " " , shadowed_address.address .type ())
@@ -1017,7 +1016,7 @@ get_shadow_memory_for_matched_object(
10171016
10181017 if (base_cond.is_true () && expr_cond.is_true ())
10191018 {
1020- #ifdef DEBUG_SM
1019+ #ifdef DEBUG_SHADOW_MEMORY
10211020 log.debug () << " exact match" << messaget::eom;
10221021#endif
10231022 exact_match = true ;
@@ -1030,7 +1029,7 @@ get_shadow_memory_for_matched_object(
10301029 {
10311030 // No point looking at further shadow addresses
10321031 // as only one of them can match.
1033- #ifdef DEBUG_SM
1032+ #ifdef DEBUG_SHADOW_MEMORY
10341033 log.debug () << " base match" << messaget::eom;
10351034#endif
10361035 result.clear ();
@@ -1039,7 +1038,7 @@ get_shadow_memory_for_matched_object(
10391038 }
10401039 else
10411040 {
1042- #ifdef DEBUG_SM
1041+ #ifdef DEBUG_SHADOW_MEMORY
10431042 log.debug () << " conditional match" << messaget::eom;
10441043#endif
10451044 result.emplace_back (
0 commit comments