Skip to content

Commit 44b82be

Browse files
committed
Shared: Elaborate qldoc.
1 parent 85b621a commit 44b82be

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

shared/controlflow/codeql/controlflow/Guards.qll

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,29 @@
2323
* }
2424
* ```
2525
*
26+
* The provided predicates are separated into general "controls" predicates and
27+
* "directly controls" predicates. The former use all possible implication
28+
* logic as described above, whereas the latter only use control flow dominance
29+
* of the corresponding conditional successor edges.
30+
*
31+
* In some cases, a guard may have a successor edge that can be relevant for
32+
* controlling the input to an SSA phi node, but does not dominate the
33+
* preceeding block. To support this, the `hasBranchEdge` and
34+
* `controlsBranchEdge` predicates are provided, where the former only uses the
35+
* control flow graph similar to the `directlyControls` predicate, and the
36+
* latter uses the full implication logic.
37+
*
38+
* All of these predicates are also available in the more general form that refers
39+
* to `GuardValue`s instead of `boolean`s.
40+
*
2641
* The implementation is nested in two parameterized modules intended to
2742
* facilitate multiple instantiations of the nested module with different
28-
* precision levels
43+
* precision levels. For example, more implications are available if the result
44+
* of Range Analysis is available, but Range Analysis depends on Guards. This
45+
* allows an initial instantiation of the `Logic` module without Range Analysis
46+
* that can be used as input to Range Analysis, and a second instantiation
47+
* using the result of Range Analysis to provide a final and more complete
48+
* controls relation.
2949
*/
3050

3151
private import codeql.util.Boolean

0 commit comments

Comments
 (0)