Skip to content

Commit bf5cef8

Browse files
authored
Merge pull request diffblue#3143 from johnnonweiler/doc/reduce-doxygen-warnings-4
Correct parameter documentation
2 parents da12819 + 637610f commit bf5cef8

File tree

1 file changed

+56
-52
lines changed

1 file changed

+56
-52
lines changed

jbmc/src/java_bytecode/java_local_variable_table.cpp

Lines changed: 56 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ struct is_predecessor_oft
157157
// Helper routines for the find-initializers code below:
158158

159159
/// 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`
164164
static void gather_transitive_predecessors(
165165
local_variable_with_holest *start,
166166
const predecessor_mapt &predecessor_map,
@@ -176,8 +176,8 @@ static void gather_transitive_predecessors(
176176
}
177177

178178
/// 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
181181
/// \return Returns true if `inst` is any form of store instruction targeting
182182
/// slot `slotidx`
183183
static bool is_store_to_slot(
@@ -212,9 +212,9 @@ static bool is_store_to_slot(
212212
}
213213

214214
/// 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
218218
static void maybe_add_hole(
219219
local_variable_with_holest &var,
220220
java_bytecode_convert_methodt::method_offsett from,
@@ -228,9 +228,9 @@ static void maybe_add_hole(
228228
}
229229

230230
/// 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
234234
/// variable table entry pointers, such that `live_variable_at_address[addr]`
235235
/// yields the unique table entry covering that address. Asserts if entries
236236
/// overlap.
@@ -277,6 +277,8 @@ static void populate_variable_address_map(
277277
/// method
278278
/// \param [out] predecessor_map:
279279
/// the output of the function, populated as described above
280+
/// \param msg_handler:
281+
/// for reporting warnings
280282
static void populate_predecessor_map(
281283
local_variable_table_with_holest::iterator firstvar,
282284
local_variable_table_with_holest::iterator varlimit,
@@ -417,9 +419,8 @@ static void populate_predecessor_map(
417419

418420
/// Used to find out where to put a variable declaration that subsumes several
419421
/// 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
423424
/// \return Returns the bytecode address of the closest common dominator of all
424425
/// given variable table entries. In the worst case the function entry point
425426
/// should always satisfy this criterion.
@@ -475,13 +476,13 @@ static java_bytecode_convert_methodt::method_offsett get_common_dominator(
475476
}
476477

477478
/// 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
480481
/// 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).
485486
static void populate_live_range_holes(
486487
local_variable_with_holest &merge_into,
487488
const std::set<local_variable_with_holest *> &merge_vars,
@@ -507,12 +508,13 @@ static void populate_live_range_holes(
507508
}
508509

509510
/// 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
516518
static void merge_variable_table_entries(
517519
local_variable_with_holest &merge_into,
518520
const std::set<local_variable_with_holest *> &merge_vars,
@@ -561,12 +563,14 @@ static void merge_variable_table_entries(
561563
/// entry with holes, such that after combination we can create a single
562564
/// GOTO variable per variable table entry, placed at the live range's start
563565
/// 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,
565570
/// 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
570574
void java_bytecode_convert_methodt::find_initializers_for_slot(
571575
local_variable_table_with_holest::iterator firstvar,
572576
local_variable_table_with_holest::iterator varlimit,
@@ -635,11 +639,11 @@ void java_bytecode_convert_methodt::find_initializers_for_slot(
635639

636640
/// Walk a vector, a contiguous block of entries with equal slot index at a
637641
/// 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.
643647
static void walk_to_next_index(
644648
local_variable_table_with_holest::iterator &it1,
645649
local_variable_table_with_holest::iterator &it2,
@@ -659,11 +663,11 @@ static void walk_to_next_index(
659663
}
660664

661665
/// 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`
667671
void java_bytecode_convert_methodt::find_initializers(
668672
local_variable_table_with_holest &vars,
669673
const address_mapt &amap,
@@ -682,9 +686,9 @@ void java_bytecode_convert_methodt::find_initializers(
682686
find_initializers_for_slot(it1, it2, amap, dominator_analysis);
683687
}
684688

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
688692
static void cleanup_var_table(
689693
std::vector<local_variable_with_holest> &vars_with_holes)
690694
{
@@ -708,11 +712,11 @@ static void cleanup_var_table(
708712
}
709713

710714
/// 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`
716720
void java_bytecode_convert_methodt::setup_local_variables(
717721
const methodt &m,
718722
const address_mapt &amap)
@@ -825,8 +829,8 @@ void java_bytecode_convert_methodt::setup_local_variables(
825829
}
826830

827831
/// 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
830834
/// \return Returns the list entry covering this address (taking live range
831835
/// holes into account), or creates/returns an anonymous variable entry if
832836
/// nothing covers `address`.

0 commit comments

Comments
 (0)