@@ -83,9 +83,8 @@ void goto_convertt::convert_msc_leave(
83
83
convert (d_code, dest, mode);
84
84
}
85
85
86
- goto_programt::targett t=dest.add_instruction ();
87
- t->make_goto (targets.leave_target );
88
- t->source_location =code.source_location ();
86
+ dest.add (
87
+ goto_programt::make_goto (targets.leave_target , code.source_location ()));
89
88
}
90
89
91
90
void goto_convertt::convert_try_catch (
@@ -112,8 +111,7 @@ void goto_convertt::convert_try_catch(
112
111
113
112
// add a SKIP target for the end of everything
114
113
goto_programt end;
115
- goto_programt::targett end_target=end.add_instruction ();
116
- end_target->make_skip ();
114
+ goto_programt::targett end_target = end.add (goto_programt::make_skip ());
117
115
118
116
// the first operand is the 'try' block
119
117
convert (to_code (code.op0 ()), dest, mode);
@@ -124,7 +122,7 @@ void goto_convertt::convert_try_catch(
124
122
catch_pop_instruction->code =code_pop_catcht ();
125
123
126
124
// add a goto to the end of the 'try' block
127
- dest.add_instruction ()-> make_goto (end_target);
125
+ dest.add ( goto_programt:: make_goto (end_target) );
128
126
129
127
for (std::size_t i=1 ; i<code.operands ().size (); i++)
130
128
{
@@ -140,7 +138,7 @@ void goto_convertt::convert_try_catch(
140
138
dest.destructive_append (tmp);
141
139
142
140
// add a goto to the end of the 'catch' block
143
- dest.add_instruction ()-> make_goto (end_target);
141
+ dest.add ( goto_programt:: make_goto (end_target) );
144
142
}
145
143
146
144
catch_push_instruction->code =push_catch_code;
@@ -205,19 +203,17 @@ void goto_convertt::convert_CPROVER_throw(
205
203
code.source_location (), targets.throw_stack_size , dest, mode);
206
204
207
205
// add goto
208
- goto_programt::targett t=dest.add_instruction ();
209
- t->make_goto (targets.throw_target );
210
- t->source_location =code.source_location ();
206
+ dest.add (
207
+ goto_programt::make_goto (targets.throw_target , code.source_location ()));
211
208
}
212
209
else // otherwise, we do a return
213
210
{
214
211
// need to process destructor stack
215
212
unwind_destructor_stack (code.source_location (), 0 , dest, mode);
216
213
217
214
// add goto
218
- goto_programt::targett t=dest.add_instruction ();
219
- t->make_goto (targets.return_target );
220
- t->source_location =code.source_location ();
215
+ dest.add (
216
+ goto_programt::make_goto (targets.return_target , code.source_location ()));
221
217
}
222
218
}
223
219
0 commit comments