@@ -27,9 +27,9 @@ template <class T>
27
27
struct procedure_local_cfg_baset <
28
28
T,
29
29
java_bytecode_convert_methodt::method_with_amapt,
30
- java_bytecode_convert_methodt:: method_offsett>
30
+ method_offsett>
31
31
: public grapht<
32
- cfg_base_nodet<T, java_bytecode_convert_methodt:: method_offsett>>
32
+ cfg_base_nodet<T, method_offsett>>
33
33
{
34
34
typedef grapht<
35
35
cfg_base_nodet<T, java_bytecode_convert_methodt::method_offsett>>
@@ -51,7 +51,7 @@ struct procedure_local_cfg_baset<
51
51
for (const auto &inst : amap)
52
52
{
53
53
// Map instruction PCs onto node indices:
54
- entry_map[inst.first ]= this ->add_node ();
54
+ entry_map[inst.first ] = static_cast <method_offsett>( this ->add_node () );
55
55
// Map back:
56
56
(*this )[entry_map[inst.first ]].PC =inst.first ;
57
57
}
@@ -238,14 +238,13 @@ static bool is_store_to_slot(
238
238
// / \param [out] var: A hole is added to `var`, unless it would be of zero size
239
239
static void maybe_add_hole (
240
240
local_variable_with_holest &var,
241
- java_bytecode_convert_methodt:: method_offsett from,
242
- java_bytecode_convert_methodt:: method_offsett to)
241
+ method_offsett from,
242
+ method_offsett to)
243
243
{
244
244
PRECONDITION (to>=from);
245
245
if (to!=from)
246
246
var.holes .push_back (
247
- {from,
248
- static_cast <java_bytecode_convert_methodt::method_offsett>(to - from)});
247
+ {from, static_cast <method_offsett>(to - from)});
249
248
}
250
249
251
250
// / See above
@@ -262,10 +261,17 @@ static void populate_variable_address_map(
262
261
{
263
262
for (auto it=firstvar, itend=varlimit; it!=itend; ++it)
264
263
{
265
- if (it->var .start_pc +it->var .length >live_variable_at_address.size ())
266
- live_variable_at_address.resize (it->var .start_pc +it->var .length );
264
+ if (
265
+ static_cast <std::size_t >(it->var .start_pc + it->var .length ) >
266
+ live_variable_at_address.size ())
267
+ {
268
+ live_variable_at_address.resize (
269
+ static_cast <std::size_t >(it->var .start_pc + it->var .length ));
270
+ }
267
271
268
- for (auto idx = it->var .start_pc , idxlim = it->var .start_pc + it->var .length ;
272
+ for (method_offsett idx = it->var .start_pc ,
273
+ idxlim = static_cast <method_offsett>(
274
+ it->var .start_pc + it->var .length );
269
275
idx != idxlim;
270
276
++idx)
271
277
{
@@ -332,7 +338,8 @@ static void populate_predecessor_map(
332
338
#endif
333
339
334
340
// Find the last instruction within the live range:
335
- const auto end_pc = it->var .start_pc + it->var .length ;
341
+ const auto end_pc =
342
+ static_cast <method_offsett>(it->var .start_pc + it->var .length );
336
343
auto amapit=amap.find (end_pc);
337
344
INVARIANT (
338
345
amapit!=amap.begin (),
@@ -445,22 +452,20 @@ static void populate_predecessor_map(
445
452
// / \return Returns the bytecode address of the closest common dominator of all
446
453
// / given variable table entries. In the worst case the function entry point
447
454
// / should always satisfy this criterion.
448
- static java_bytecode_convert_methodt:: method_offsett get_common_dominator (
455
+ static method_offsett get_common_dominator (
449
456
const std::set<local_variable_with_holest *> &merge_vars,
450
457
const java_cfg_dominatorst &dominator_analysis)
451
458
{
452
459
PRECONDITION (!merge_vars.empty ());
453
460
454
- auto first_pc =
455
- std::numeric_limits<java_bytecode_convert_methodt::method_offsett>::max ();
461
+ auto first_pc = std::numeric_limits<method_offsett>::max ();
456
462
for (auto v : merge_vars)
457
463
{
458
464
if (v->var .start_pc <first_pc)
459
465
first_pc=v->var .start_pc ;
460
466
}
461
467
462
- std::vector<java_bytecode_convert_methodt::method_offsett>
463
- candidate_dominators;
468
+ std::vector<method_offsett> candidate_dominators;
464
469
for (auto v : merge_vars)
465
470
{
466
471
const auto &dominator_nodeidx=
@@ -507,7 +512,7 @@ static java_bytecode_convert_methodt::method_offsett get_common_dominator(
507
512
static void populate_live_range_holes (
508
513
local_variable_with_holest &merge_into,
509
514
const std::set<local_variable_with_holest *> &merge_vars,
510
- java_bytecode_convert_methodt:: method_offsett expanded_live_range_start)
515
+ method_offsett expanded_live_range_start)
511
516
{
512
517
std::vector<local_variable_with_holest *> sorted_by_startpc (
513
518
merge_vars.begin (), merge_vars.end ());
@@ -555,16 +560,17 @@ static void merge_variable_table_entries(
555
560
// as it was not visible in the original local variable table)
556
561
populate_live_range_holes (merge_into, merge_vars, found_dominator);
557
562
558
- java_bytecode_convert_methodt:: method_offsett last_pc = 0 ;
563
+ method_offsett last_pc = 0 ;
559
564
for (auto v : merge_vars)
560
565
{
561
- if (v->var .start_pc + v->var .length > last_pc)
562
- last_pc= v->var .start_pc + v->var .length ;
566
+ if (static_cast <method_offsett>( v->var .start_pc + v->var .length ) > last_pc)
567
+ last_pc = static_cast <method_offsett>( v->var .start_pc + v->var .length ) ;
563
568
}
564
569
565
570
// Apply the changes:
566
571
merge_into.var .start_pc =found_dominator;
567
- merge_into.var .length =last_pc-found_dominator;
572
+ merge_into.var .length =
573
+ static_cast <method_offsett>(last_pc - found_dominator);
568
574
569
575
#ifdef DEBUG
570
576
debug_out << " Merged " << merge_vars.size () << " variables named "
@@ -850,7 +856,7 @@ void java_bytecode_convert_methodt::setup_local_variables(
850
856
// / nothing covers `address`.
851
857
const java_bytecode_convert_methodt::variablet &
852
858
java_bytecode_convert_methodt::find_variable_for_slot (
853
- size_t address,
859
+ method_offsett address,
854
860
variablest &var_list)
855
861
{
856
862
for (const variablet &var : var_list)
0 commit comments