@@ -157,10 +157,10 @@ struct is_predecessor_oft
157
157
// Helper routines for the find-initializers code below:
158
158
159
159
// / See above
160
- // / ` start` : Variable to find the predecessors of `predecessor_map`: Map from
161
- // / local variables to sets of predecessors
162
- // / \param Outputs: ` result` : populated with all transitive predecessors of
163
- // / `start` found in `predecessor_map`
160
+ // / \param start: Variable to find the predecessors of
161
+ // / \param predecessor_map: Map from local variables to sets of predecessors
162
+ // / \param [out] result: populated with all transitive predecessors of `start`
163
+ // / found in `predecessor_map`
164
164
static void gather_transitive_predecessors (
165
165
local_variable_with_holest *start,
166
166
const predecessor_mapt &predecessor_map,
@@ -176,8 +176,8 @@ static void gather_transitive_predecessors(
176
176
}
177
177
178
178
// / See above
179
- // / \par parameters: ` inst` : Java bytecode instruction
180
- // / ` slotidx` : local variable slot number
179
+ // / \param inst: Java bytecode instruction
180
+ // / \param slotidx: local variable slot number
181
181
// / \return Returns true if `inst` is any form of store instruction targeting
182
182
// / slot `slotidx`
183
183
static bool is_store_to_slot (
@@ -212,9 +212,9 @@ static bool is_store_to_slot(
212
212
}
213
213
214
214
// / See above
215
- // / \par parameters: ` from`, `to`: bounds of a gap in `var`'s live range,
216
- // / inclusive and exclusive respectively
217
- // / \return Adds a hole to `var`, unless it would be of zero size.
215
+ // / \param from: bound of a gap in `var`'s live range (inclusive)
216
+ // / \param to: bound of a gap in `var`'s live range (exclusive)
217
+ // / \param [out] var: A hole is added to `var`, unless it would be of zero size
218
218
static void maybe_add_hole (
219
219
local_variable_with_holest &var,
220
220
java_bytecode_convert_methodt::method_offsett from,
@@ -228,9 +228,9 @@ static void maybe_add_hole(
228
228
}
229
229
230
230
// / See above
231
- // / \par parameters: ` firstvar`-`varlimit`: range of local variable table
232
- // / entries to consider
233
- // / \return `live_variable_at_address` is populated with a sequence of local
231
+ // / \param firstvar: start of range of local variable table entries to consider
232
+ // / \param varlimit: end of range of local variable table entries to consider
233
+ // / \param [out] live_variable_at_address: populated with a sequence of local
234
234
// / variable table entry pointers, such that `live_variable_at_address[addr]`
235
235
// / yields the unique table entry covering that address. Asserts if entries
236
236
// / overlap.
@@ -277,6 +277,8 @@ static void populate_variable_address_map(
277
277
// / method
278
278
// / \param [out] predecessor_map:
279
279
// / the output of the function, populated as described above
280
+ // / \param msg_handler:
281
+ // / for reporting warnings
280
282
static void populate_predecessor_map (
281
283
local_variable_table_with_holest::iterator firstvar,
282
284
local_variable_table_with_holest::iterator varlimit,
@@ -417,9 +419,8 @@ static void populate_predecessor_map(
417
419
418
420
// / Used to find out where to put a variable declaration that subsumes several
419
421
// / variable live ranges.
420
- // / \par parameters: `merge_vars`: Set of variables we want the common dominator
421
- // / for.
422
- // / `dominator_analysis`: Already-initialized dominator tree
422
+ // / \param merge_vars: Set of variables we want the common dominator for
423
+ // / \param dominator_analysis: Already-initialized dominator tree
423
424
// / \return Returns the bytecode address of the closest common dominator of all
424
425
// / given variable table entries. In the worst case the function entry point
425
426
// / should always satisfy this criterion.
@@ -475,13 +476,13 @@ static java_bytecode_convert_methodt::method_offsett get_common_dominator(
475
476
}
476
477
477
478
// / See above
478
- // / \par parameters: ` merge_vars` : a set of 2+ variable table entries to merge
479
- // / ` expanded_live_range_start` : address where the merged variable will be
479
+ // / \param merge_vars: a set of 2+ variable table entries to merge
480
+ // / \param expanded_live_range_start: address where the merged variable will be
480
481
// / declared
481
- // / \return Adds holes to `merge_into`, indicating where gaps in the variable's
482
- // / live range fall. For example, if the declaration happens at address 10 and
483
- // / the entries in `merge_into` have live ranges [(20-30), (40-50)] then holes
484
- // / will be added at (10-20) and (30-40).
482
+ // / \param [out] merge_into: Holes are added to `merge_into`, indicating where
483
+ // / gaps in the variable's live range fall. For example, if the declaration
484
+ // / happens at address 10 and the entries in `merge_into` have live ranges
485
+ // / [(20-30), (40-50)] then holes will be added at (10-20) and (30-40).
485
486
static void populate_live_range_holes (
486
487
local_variable_with_holest &merge_into,
487
488
const std::set<local_variable_with_holest *> &merge_vars,
@@ -507,12 +508,13 @@ static void populate_live_range_holes(
507
508
}
508
509
509
510
// / See above
510
- // / \par parameters: `merge_vars`: a set of 2+ variable table entries to merge
511
- // / `dominator_analysis`: already-calculated dominator tree
512
- // / \return Populates `merge_into` as a combined variable table entry, with live
513
- // / range holes if the `merge_vars` entries do not cover a contiguous address
514
- // / range, beginning the combined live range at the common dominator of all
515
- // / `merge_vars`.
511
+ // / \param merge_vars: a set of 2+ variable table entries to merge
512
+ // / \param dominator_analysis: already-calculated dominator tree
513
+ // / \param [out] merge_into: Populated as a combined variable table entry, with
514
+ // / live range holes if the `merge_vars` entries do not cover a contiguous
515
+ // / address range, beginning the combined live range at the common dominator
516
+ // / of all `merge_vars`.
517
+ // / \param debug_out: stream for debug output
516
518
static void merge_variable_table_entries (
517
519
local_variable_with_holest &merge_into,
518
520
const std::set<local_variable_with_holest *> &merge_vars,
@@ -561,12 +563,14 @@ static void merge_variable_table_entries(
561
563
// / entry with holes, such that after combination we can create a single
562
564
// / GOTO variable per variable table entry, placed at the live range's start
563
565
// / address, which may be moved back so that the declaration dominates all uses.
564
- // / \par parameters: `firstvar`-`varlimit`: sequence of variable table entries,
566
+ // / Side-effect: merges variable table entries which flow into one another
567
+ // / (e.g. there are branches from one live range to another without
568
+ // / re-initializing the local slot).
569
+ // / \param firstvar: start of sequence of variable table entries,
565
570
// / all of which should concern the same slot index.
566
- // / `amap`: Map from bytecode address to instruction
567
- // / \return Side-effect: merges variable table entries which flow into one
568
- // / another (e.g. there are branches from one live range to another without
569
- // / re-initializing the local slot).
571
+ // / \param varlimit: end of sequence of variable table entries
572
+ // / \param amap: map from bytecode address to instruction
573
+ // / \param dominator_analysis: already-calculated dominator tree
570
574
void java_bytecode_convert_methodt::find_initializers_for_slot (
571
575
local_variable_table_with_holest::iterator firstvar,
572
576
local_variable_table_with_holest::iterator varlimit,
@@ -635,11 +639,11 @@ void java_bytecode_convert_methodt::find_initializers_for_slot(
635
639
636
640
// / Walk a vector, a contiguous block of entries with equal slot index at a
637
641
// / time.
638
- // / \par parameters: `it1` and `it2`, which are iterators into the same vector,
639
- // / of which `itend` is the end() iterator.
640
- // / \return Moves `it1` and `it2` to delimit a sequence of variable table
641
- // / entries with slot index equal to it2->var.index on entering this function,
642
- // / or to both equal itend if it2==itend on entry.
642
+ // / `it1` and `it2` are iterators into the same vector, of which `itend` is the
643
+ // / end() iterator.
644
+ // / `it1` and `it2` are moved to delimit a sequence of variable table
645
+ // / entries with slot index equal to it2->var.index on entering this function,
646
+ // / or to both equal itend if it2==itend on entry.
643
647
static void walk_to_next_index (
644
648
local_variable_table_with_holest::iterator &it1,
645
649
local_variable_table_with_holest::iterator &it2,
@@ -659,11 +663,11 @@ static void walk_to_next_index(
659
663
}
660
664
661
665
// / See `find_initializers_for_slot` above for more detail.
662
- // / \par parameters: `vars`: Local variable table
663
- // / `amap`: Map from bytecode index to instruction
664
- // / `dominator_analysis`: Already computed dominator tree for the Java function
665
- // / described by `amap`
666
- // / \return Combines entries in `vars` which flow together
666
+ // / Combines entries in `vars` which flow together.
667
+ // / \param vars: Local variable table
668
+ // / \param amap: Map from bytecode index to instruction
669
+ // / \param dominator_analysis: Already computed dominator tree for the Java
670
+ // / function described by `amap`
667
671
void java_bytecode_convert_methodt::find_initializers (
668
672
local_variable_table_with_holest &vars,
669
673
const address_mapt &amap,
@@ -682,9 +686,9 @@ void java_bytecode_convert_methodt::find_initializers(
682
686
find_initializers_for_slot (it1, it2, amap, dominator_analysis);
683
687
}
684
688
685
- // / See above
686
- // / \par parameters: `vars_with_holes`: variable table
687
- // / \return Removes zero-size entries from `vars_with_holes`
689
+ // / See above.
690
+ // / Removes zero-size entries from `vars_with_holes`.
691
+ // / \param vars_with_holes: variable table
688
692
static void cleanup_var_table (
689
693
std::vector<local_variable_with_holest> &vars_with_holes)
690
694
{
@@ -708,11 +712,11 @@ static void cleanup_var_table(
708
712
}
709
713
710
714
// / See `find_initializers_for_slot` above for more detail.
711
- // / \par parameters: `m`: Java method
712
- // / `amap`: Map from bytecode indices to instructions in `m`
713
- // / \return Populates `this->vars_with_holes` equal to
714
- // / `this->local_variable_table`, only with variable table entries that flow
715
- // / together combined. Also symbol-table registers all locals.
715
+ // / Populates `this->vars_with_holes` equal to `this->local_variable_table`,
716
+ // / only with variable table entries that flow together combined. Also
717
+ // / symbol-table registers all locals.
718
+ // / \param m: Java method
719
+ // / \param amap: Map from bytecode indices to instructions in `m`
716
720
void java_bytecode_convert_methodt::setup_local_variables (
717
721
const methodt &m,
718
722
const address_mapt &amap)
@@ -825,8 +829,8 @@ void java_bytecode_convert_methodt::setup_local_variables(
825
829
}
826
830
827
831
// / See above
828
- // / \par parameters: ` address` : Address to find a variable table entry for
829
- // / ` var_list` : List of candidates that use the slot we're interested in
832
+ // / \param address: Address to find a variable table entry for
833
+ // / \param var_list: List of candidates that use the slot we're interested in
830
834
// / \return Returns the list entry covering this address (taking live range
831
835
// / holes into account), or creates/returns an anonymous variable entry if
832
836
// / nothing covers `address`.
0 commit comments