Skip to content

Commit

Permalink
[doc] Fix some odoc warnings
Browse files Browse the repository at this point in the history
Summary:
This diff fixes some odoc warnings:

* A title cannot have a reference.
* Sometimes full module paths are needed.
* It cannot have a link to external modules such as `Fmt`.

Reviewed By: dulmarod

Differential Revision: D51425757

fbshipit-source-id: 09c3779af0d63e0cad353a4728a25c3d40e86fdb
  • Loading branch information
skcho authored and facebook-github-bot committed Nov 17, 2023
1 parent 1297803 commit 8fbe726
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 26 deletions.
2 changes: 1 addition & 1 deletion infer/src/IR/AnalysisGlobalState.mli
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ open! IStd
as possible!), it is sometimes too convenient to ignore. This module lets us do it safely, at
least until infer becomes multicore. In particular, global state is appropriately and safely
stashed away and restored when the analysis of a procedure is suspended to go analyze another
procedure with ondemand (see the {!Ondemand} module). *)
procedure with ondemand (see the {!Backend.Ondemand} module). *)

type t

Expand Down
4 changes: 2 additions & 2 deletions infer/src/IR/Sil.mli
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ type instr_metadata =
[@@deriving compare]

(** An instruction. Syntactic invariants of instructions per-frontend are documented in
{!SilValidation}, where Clang is the most general validator (that is, it properly subsumes all
other validators). These invariants are enforced when --sil-validation is passed. *)
{!Checkers.SilValidation}, where Clang is the most general validator (that is, it properly
subsumes all other validators). These invariants are enforced when --sil-validation is passed. *)
type instr =
| Load of {id: Ident.t; e: Exp.t; typ: Typ.t; loc: Location.t}
(** Load a value from the heap into an identifier.
Expand Down
22 changes: 12 additions & 10 deletions infer/src/checkers/LineageShape.mli
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ module Cell : sig
A field path of a cell:
- Cannot have a length greater than {!Config.lineage_field_depth}. For instance, if that limit
is [2], the only cell under both [X#foo#bar#baz] and [X#foo#bar#ham] will be [X#foo#bar].
- Cannot have a length greater than {!IBase.Config.lineage_field_depth}. For instance, if that
limit is [2], the only cell under both [X#foo#bar#baz] and [X#foo#bar#ham] will be
[X#foo#bar].
- Cannot cross a field whose field table is wider than {!Config.lineage_field_width}. For
instance, of the variable [X] has a huge number of fields, the only cell under [X#field1]
will be [X] itself.
- Cannot cross a field whose field table is wider than {!IBase.Config.lineage_field_width}.
For instance, of the variable [X] has a huge number of fields, the only cell under
[X#field1] will be [X] itself.
- Cannot go twice on same-typed fields if {!Config.lineage_prevent_cycles} is set. For
- Cannot go twice on same-typed fields if {!IBase.Config.lineage_prevent_cycles} is set. For
instance, if [X] has fields [X#head] and [X#tail], and [X#tail] has the same shape as [X],
then the cells under [X] will be [X#head] and [X#tail].
Expand Down Expand Up @@ -88,11 +89,12 @@ module Summary : sig
t option -> Var.t * FieldPath.t -> init:'accum -> f:('accum -> Cell.t -> 'accum) -> 'accum
(** Folds over all cells under a variable and field path. A field path is "terminal" if its length
(that includes the prefixed fields given as parameters) is equal to
[Config.lineage_field_depth], or no more field can be subscripted from its corresponding type,
or it has strictly more than [Config.lineage_field_width] immediate subfields.
{!IBase.Config.lineage_field_depth}, or no more field can be subscripted from its
corresponding type, or it has strictly more than {!IBase.Config.lineage_field_width} immediate
subfields.
The result will not cross any shape whose field table is wider than
[Config.lineage_field_width], even if one of the parameter does. For instance, if some
{!IBase.Config.lineage_field_width}, even if one of the parameter does. For instance, if some
variable [X] has a huge number of fields, the only terminal field of [X#field1] will be [X]
itself.
Expand All @@ -106,7 +108,7 @@ module Summary : sig
-> f:('accum -> Cell.t -> Cell.t -> 'accum)
-> 'accum
(** Folds over all corresponding cell pairs of two same-shape variable and field paths. See
{!fold_terminal_fields}.
{!fold_cells}.
Dies if the parameters do not have the same shape.
Expand Down
8 changes: 4 additions & 4 deletions infer/src/istd/IFmt.mli
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
* LICENSE file in the root directory of this source tree.
*)

(** Low-level combinators built on {!Fmt}. Sophisticated pretty-printing functions should rather go
(** Low-level combinators built on [Fmt]. Sophisticated pretty-printing functions should rather go
in {!Pp}. *)

val colon_sp : 'a Fmt.t
(** [colon_sp] is [Fmt.any ":@ "]. It prints a colon and a space break hint. *)

module Labelled : sig
(** Adapters of {!Fmt} functions using labelled interfaces *)
(** Adapters of [Fmt] functions using labelled interfaces *)

val iter : ?sep:unit Fmt.t -> ('a -> f:('elt -> unit) -> unit) -> 'elt Fmt.t -> 'a Fmt.t
[@@warning "-unused-value-declaration"]
(** {!Fmt.iter} using a Core-style labelled iterator function *)
(** [Fmt.iter] using a Core-style labelled iterator function *)

val iter_bindings :
?sep:unit Fmt.t
-> ('a -> f:(key:'key -> data:'data -> unit) -> unit)
-> ('key * 'data) Fmt.t
-> 'a Fmt.t
(** {!Fmt.iter_bindings} using a Core-style (key, data) labelled iterator function *)
(** [Fmt.iter_bindings] using a Core-style (key, data) labelled iterator function *)
end
2 changes: 1 addition & 1 deletion infer/src/pulse/PulseAbductiveDomain.mli
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module Decompiler = PulseDecompiler
module DecompilerExpr = PulseDecompilerExpr
module PathContext = PulsePathContext

(** {2 Abductive, value-normalizing layer on top of {!BaseDomain}}
(** {2 Abductive, value-normalizing layer on top of [BaseDomain]}
The operations in this module take care of two things that are important for the safety of
domain operations:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Cell (infer.Checkers.LineageShape.Cell)</title><link rel="stylesheet" href="../../../../_odoc_support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../_odoc_support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a><a href="../../../index.html">infer</a> &#x00BB; <a href="../../index.html">Checkers</a> &#x00BB; <a href="../index.html">LineageShape</a> &#x00BB; Cell</nav><header class="odoc-preamble"><h1>Module <code><span>LineageShape.Cell</span></code></h1><p>Cells correspond to variable fields for which no subfield will be considered by the analysis, either because they semantically have none, or because the abstract domain decides that considering them would lead to too deep or too wide field structures.</p><p>A field path of a cell:</p><ul><li>Cannot have a length greater than <code>Config</code>.lineage_field_depth. For instance, if that limit is <code>2</code>, the only cell under both <code>X#foo#bar#baz</code> and <code>X#foo#bar#ham</code> will be <code>X#foo#bar</code>.</li></ul><ul><li>Cannot cross a field whose field table is wider than <code>Config</code>.lineage_field_width. For instance, of the variable <code>X</code> has a huge number of fields, the only cell under <code>X#field1</code> will be <code>X</code> itself.</li></ul><ul><li>Cannot go twice on same-typed fields if <code>Config</code>.lineage_prevent_cycles is set. For instance, if <code>X</code> has fields <code>X#head</code> and <code>X#tail</code>, and <code>X#tail</code> has the same shape as <code>X</code>, then the cells under <code>X</code> will be <code>X#head</code> and <code>X#tail</code>.</li></ul><p>If one of these conditions happens, then the cell field path will be truncated before reaching a &quot;scalar&quot; field and the cell will be &quot;abstract&quot;.</p><p>To make sure that the aforementioned properties hold, one cannot construct cells directly, but should access them through the <a href="../Summary/index.html#val-fold_cells"><code>Summary.fold_cells</code></a> and <a href="../Summary/index.html#val-fold_cell_pairs"><code>Summary.fold_cell_pairs</code></a> functions.</p><p>The lineage graph is built on cells.</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span></code></div></div><div class="odoc-include"><details open="open"><summary class="spec include"><code><span><span class="keyword">include</span> <span class="xref-unresolved">Ppx_compare_lib</span>.Comparable.S <span class="keyword">with</span> <span><span class="keyword">type</span> <span class="xref-unresolved">t</span> := <span class="xref-unresolved">t</span></span></span></code></summary><div class="odoc-spec"><div class="spec value anchored" id="val-compare"><a href="#val-compare" class="anchor"></a><code><span><span class="keyword">val</span> compare : <span><a href="#type-t">t</a> <span class="xref-unresolved">Base__Ppx_compare_lib</span>.compare</span></span></code></div></div></details></div><div class="odoc-include"><details open="open"><summary class="spec include"><code><span><span class="keyword">include</span> <span class="xref-unresolved">Ppx_compare_lib</span>.Equal.S <span class="keyword">with</span> <span><span class="keyword">type</span> <span class="xref-unresolved">t</span> := <span class="xref-unresolved">t</span></span></span></code></summary><div class="odoc-spec"><div class="spec value anchored" id="val-equal"><a href="#val-equal" class="anchor"></a><code><span><span class="keyword">val</span> equal : <span><a href="#type-t">t</a> <span class="xref-unresolved">Base__Ppx_compare_lib</span>.equal</span></span></code></div></div></details></div><div class="odoc-include"><details open="open"><summary class="spec include"><code><span><span class="keyword">include</span> <span class="xref-unresolved">Sexplib0</span>.Sexpable.S <span class="keyword">with</span> <span><span class="keyword">type</span> <span class="xref-unresolved">t</span> := <span class="xref-unresolved">t</span></span></span></code></summary><div class="odoc-spec"><div class="spec value anchored" id="val-t_of_sexp"><a href="#val-t_of_sexp" class="anchor"></a><code><span><span class="keyword">val</span> t_of_sexp : <span><span class="xref-unresolved">Sexplib0__</span>.Sexp.t <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-sexp_of_t"><a href="#val-sexp_of_t" class="anchor"></a><code><span><span class="keyword">val</span> sexp_of_t : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span class="xref-unresolved">Sexplib0__</span>.Sexp.t</span></code></div></div></details></div><div class="odoc-spec"><div class="spec value anchored" id="val-yojson_of_t"><a href="#val-yojson_of_t" class="anchor"></a><code><span><span class="keyword">val</span> yojson_of_t : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span class="xref-unresolved">Ppx_yojson_conv_lib</span>.Yojson.Safe.t</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-pp"><a href="#val-pp" class="anchor"></a><code><span><span class="keyword">val</span> pp : <span><a href="#type-t">t</a> <span class="xref-unresolved">Fmt</span>.t</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-var"><a href="#val-var" class="anchor"></a><code><span><span class="keyword">val</span> var : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="../../../IR/Var/index.html#type-t">IR.Var.t</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-field_path"><a href="#val-field_path" class="anchor"></a><code><span><span class="keyword">val</span> field_path : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="../FieldPath/index.html#type-t">FieldPath.t</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-is_abstract"><a href="#val-is_abstract" class="anchor"></a><code><span><span class="keyword">val</span> is_abstract : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-var_appears_in_source_code"><a href="#val-var_appears_in_source_code" class="anchor"></a><code><span><span class="keyword">val</span> var_appears_in_source_code : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div></div></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Cell (infer.Checkers.LineageShape.Cell)</title><link rel="stylesheet" href="../../../../_odoc_support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../_odoc_support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a><a href="../../../index.html">infer</a> &#x00BB; <a href="../../index.html">Checkers</a> &#x00BB; <a href="../index.html">LineageShape</a> &#x00BB; Cell</nav><header class="odoc-preamble"><h1>Module <code><span>LineageShape.Cell</span></code></h1><p>Cells correspond to variable fields for which no subfield will be considered by the analysis, either because they semantically have none, or because the abstract domain decides that considering them would lead to too deep or too wide field structures.</p><p>A field path of a cell:</p><ul><li>Cannot have a length greater than <a href="../../../IBase/Config/index.html#val-lineage_field_depth"><code>IBase.Config.lineage_field_depth</code></a>. For instance, if that limit is <code>2</code>, the only cell under both <code>X#foo#bar#baz</code> and <code>X#foo#bar#ham</code> will be <code>X#foo#bar</code>.</li></ul><ul><li>Cannot cross a field whose field table is wider than <a href="../../../IBase/Config/index.html#val-lineage_field_width"><code>IBase.Config.lineage_field_width</code></a>. For instance, of the variable <code>X</code> has a huge number of fields, the only cell under <code>X#field1</code> will be <code>X</code> itself.</li></ul><ul><li>Cannot go twice on same-typed fields if <a href="../../../IBase/Config/index.html#val-lineage_prevent_cycles"><code>IBase.Config.lineage_prevent_cycles</code></a> is set. For instance, if <code>X</code> has fields <code>X#head</code> and <code>X#tail</code>, and <code>X#tail</code> has the same shape as <code>X</code>, then the cells under <code>X</code> will be <code>X#head</code> and <code>X#tail</code>.</li></ul><p>If one of these conditions happens, then the cell field path will be truncated before reaching a &quot;scalar&quot; field and the cell will be &quot;abstract&quot;.</p><p>To make sure that the aforementioned properties hold, one cannot construct cells directly, but should access them through the <a href="../Summary/index.html#val-fold_cells"><code>Summary.fold_cells</code></a> and <a href="../Summary/index.html#val-fold_cell_pairs"><code>Summary.fold_cell_pairs</code></a> functions.</p><p>The lineage graph is built on cells.</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span></code></div></div><div class="odoc-include"><details open="open"><summary class="spec include"><code><span><span class="keyword">include</span> <span class="xref-unresolved">Ppx_compare_lib</span>.Comparable.S <span class="keyword">with</span> <span><span class="keyword">type</span> <span class="xref-unresolved">t</span> := <span class="xref-unresolved">t</span></span></span></code></summary><div class="odoc-spec"><div class="spec value anchored" id="val-compare"><a href="#val-compare" class="anchor"></a><code><span><span class="keyword">val</span> compare : <span><a href="#type-t">t</a> <span class="xref-unresolved">Base__Ppx_compare_lib</span>.compare</span></span></code></div></div></details></div><div class="odoc-include"><details open="open"><summary class="spec include"><code><span><span class="keyword">include</span> <span class="xref-unresolved">Ppx_compare_lib</span>.Equal.S <span class="keyword">with</span> <span><span class="keyword">type</span> <span class="xref-unresolved">t</span> := <span class="xref-unresolved">t</span></span></span></code></summary><div class="odoc-spec"><div class="spec value anchored" id="val-equal"><a href="#val-equal" class="anchor"></a><code><span><span class="keyword">val</span> equal : <span><a href="#type-t">t</a> <span class="xref-unresolved">Base__Ppx_compare_lib</span>.equal</span></span></code></div></div></details></div><div class="odoc-include"><details open="open"><summary class="spec include"><code><span><span class="keyword">include</span> <span class="xref-unresolved">Sexplib0</span>.Sexpable.S <span class="keyword">with</span> <span><span class="keyword">type</span> <span class="xref-unresolved">t</span> := <span class="xref-unresolved">t</span></span></span></code></summary><div class="odoc-spec"><div class="spec value anchored" id="val-t_of_sexp"><a href="#val-t_of_sexp" class="anchor"></a><code><span><span class="keyword">val</span> t_of_sexp : <span><span class="xref-unresolved">Sexplib0__</span>.Sexp.t <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-sexp_of_t"><a href="#val-sexp_of_t" class="anchor"></a><code><span><span class="keyword">val</span> sexp_of_t : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span class="xref-unresolved">Sexplib0__</span>.Sexp.t</span></code></div></div></details></div><div class="odoc-spec"><div class="spec value anchored" id="val-yojson_of_t"><a href="#val-yojson_of_t" class="anchor"></a><code><span><span class="keyword">val</span> yojson_of_t : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span class="xref-unresolved">Ppx_yojson_conv_lib</span>.Yojson.Safe.t</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-pp"><a href="#val-pp" class="anchor"></a><code><span><span class="keyword">val</span> pp : <span><a href="#type-t">t</a> <span class="xref-unresolved">Fmt</span>.t</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-var"><a href="#val-var" class="anchor"></a><code><span><span class="keyword">val</span> var : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="../../../IR/Var/index.html#type-t">IR.Var.t</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-field_path"><a href="#val-field_path" class="anchor"></a><code><span><span class="keyword">val</span> field_path : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="../FieldPath/index.html#type-t">FieldPath.t</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-is_abstract"><a href="#val-is_abstract" class="anchor"></a><code><span><span class="keyword">val</span> is_abstract : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-var_appears_in_source_code"><a href="#val-var_appears_in_source_code" class="anchor"></a><code><span><span class="keyword">val</span> var_appears_in_source_code : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div></div></div></body></html>
Loading

0 comments on commit 8fbe726

Please sign in to comment.