Skip to content

Commit d81dd75

Browse files
dcattaruzzapeterschrammel
authored andcommitted
Auxiliary function to retrieve tail of trace and added dead command to trace
1 parent 2987406 commit d81dd75

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/goto-programs/goto_trace.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ void goto_trace_stept::output(
6565
case goto_trace_stept::ASSIGNMENT: out << "ASSIGNMENT"; break;
6666
case goto_trace_stept::GOTO: out << "GOTO"; break;
6767
case goto_trace_stept::DECL: out << "DECL"; break;
68+
case goto_trace_stept::DEAD: out << "DEAD"; break;
6869
case goto_trace_stept::OUTPUT: out << "OUTPUT"; break;
6970
case goto_trace_stept::INPUT: out << "INPUT"; break;
7071
case goto_trace_stept::ATOMIC_BEGIN: out << "ATOMC_BEGIN"; break;
@@ -73,7 +74,9 @@ void goto_trace_stept::output(
7374
case goto_trace_stept::SHARED_WRITE: out << "SHARED WRITE"; break;
7475
case goto_trace_stept::FUNCTION_CALL: out << "FUNCTION CALL"; break;
7576
case goto_trace_stept::FUNCTION_RETURN: out << "FUNCTION RETURN"; break;
76-
default: assert(false);
77+
default:
78+
out << "unknown type: " << type << std::endl;
79+
assert(false);
7780
}
7881

7982
if(type==ASSERT || type==ASSUME || type==GOTO)

src/goto-programs/goto_trace.h

+7
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,13 @@ class goto_tracet
154154
steps.push_back(step);
155155
}
156156

157+
// retrieves the final step in the trace for manipulation
158+
// (used to fill a trace from code, hence non-const)
159+
inline goto_trace_stept &get_last_step()
160+
{
161+
return steps.back();
162+
}
163+
157164
// delete all steps after (not including) s
158165
void trim_after(stepst::iterator s)
159166
{

0 commit comments

Comments
 (0)