@@ -682,6 +682,20 @@ void goto_inlinet::expand_function_call(
682
682
function,
683
683
arguments,
684
684
constrain);
685
+
686
+ progress () << " Inserting " << identifier << " into caller" << eom;
687
+ progress () << " Number of instructions: "
688
+ << cached.body .instructions .size () << eom;
689
+
690
+ if (!caching)
691
+ {
692
+ progress () << " Removing " << identifier << " from cache" << eom;
693
+ progress () << " Number of instructions: "
694
+ << cached.body .instructions .size () << eom;
695
+
696
+ inline_log.cleanup (cached.body );
697
+ cache.erase (identifier);
698
+ }
685
699
}
686
700
else
687
701
{
@@ -944,6 +958,11 @@ const goto_inlinet::goto_functiont &goto_inlinet::goto_inline_transitive(
944
958
945
959
goto_functiont &cached=cache[identifier];
946
960
assert (cached.body .empty ());
961
+
962
+ progress () << " Creating copy of " << identifier << eom;
963
+ progress () << " Number of instructions: "
964
+ << goto_function.body .instructions .size () << eom;
965
+
947
966
cached.copy_from (goto_function); // location numbers not changed
948
967
inline_log.copy_from (goto_function.body , cached.body );
949
968
@@ -1146,6 +1165,29 @@ void goto_inlinet::output_inline_map(
1146
1165
1147
1166
/* ******************************************************************\
1148
1167
1168
+ Function: output_cache
1169
+
1170
+ Inputs:
1171
+
1172
+ Outputs:
1173
+
1174
+ Purpose:
1175
+
1176
+ \*******************************************************************/
1177
+
1178
+ void goto_inlinet::output_cache (std::ostream &out) const
1179
+ {
1180
+ for (auto it=cache.begin (); it!=cache.end (); it++)
1181
+ {
1182
+ if (it!=cache.begin ())
1183
+ out << " , " ;
1184
+
1185
+ out << it->first << " \n " ;
1186
+ }
1187
+ }
1188
+
1189
+ /* ******************************************************************\
1190
+
1149
1191
Function: cleanup
1150
1192
1151
1193
Inputs:
@@ -1257,8 +1299,9 @@ void goto_inlinet::goto_inline_logt::copy_from(
1257
1299
assert (it1->location_number ==it2->location_number );
1258
1300
1259
1301
log_mapt::const_iterator l_it=log_map.find (it1);
1260
- if (l_it!=log_map.end ())
1302
+ if (l_it!=log_map.end ()) // a segment starts here
1261
1303
{
1304
+ // as 'to' is a fresh copy
1262
1305
assert (log_map.find (it2)==log_map.end ());
1263
1306
1264
1307
goto_inline_log_infot info=l_it->second ;
0 commit comments