@@ -15,6 +15,7 @@ Date: November 2005
1515#define CPROVER_GOTO_PROGRAMS_JSON_GOTO_TRACE_H
1616
1717#include " goto_trace.h"
18+ #include " structured_trace_util.h"
1819
1920#include < algorithm>
2021#include < util/invariant.h>
@@ -101,7 +102,7 @@ void convert_return(
101102void convert_default (
102103 json_objectt &json_location_only,
103104 const conversion_dependenciest &conversion_dependencies,
104- const std::string &step_type );
105+ const default_step_kindt &step_kind );
105106
106107// / Templated version of the conversion method.
107108// / Works by dispatching to the more specialised
@@ -188,17 +189,14 @@ void convert(
188189 case goto_trace_stept::typet::SHARED_WRITE:
189190 case goto_trace_stept::typet::CONSTRAINT:
190191 case goto_trace_stept::typet::NONE:
191- const bool is_loophead = std::any_of (
192- step.pc ->incoming_edges .begin (),
193- step.pc ->incoming_edges .end (),
194- [](goto_programt::targett t) { return t->is_backwards_goto (); });
195- if (source_location != previous_source_location || is_loophead)
192+ const auto default_step_kind = ::default_step_kind (*step.pc );
193+ if (
194+ source_location != previous_source_location ||
195+ default_step_kind == default_step_kindt::LOOP_HEAD)
196196 {
197197 json_objectt &json_location_only = dest_array.push_back ().make_object ();
198198 convert_default (
199- json_location_only,
200- conversion_dependencies,
201- is_loophead ? " loop-head" : " location-only" );
199+ json_location_only, conversion_dependencies, default_step_kind);
202200 }
203201 }
204202
0 commit comments