Skip to content

Commit 9a69103

Browse files
committed
Add missing QLDocs
1 parent d7657db commit 9a69103

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

java/ql/lib/semmle/code/java/ControlFlowGraph.qll

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ private import Completion
8484
private import controlflow.internal.Preconditions
8585
private import controlflow.internal.SwitchCases
8686

87+
/** Provides the definition of control flow nodes. */
8788
module ControlFlow {
8889
private predicate hasControlFlow(Expr e) {
8990
not exists(ConstCase cc | e = cc.getValue(_)) and
@@ -155,19 +156,27 @@ module ControlFlow {
155156
result = "Exit" and this instanceof ExitNode
156157
}
157158

159+
/** Gets the source location for this element. */
158160
Location getLocation() {
159161
result = this.asExpr().getLocation() or
160162
result = this.asStmt().getLocation() or
161163
result = this.(ExitNode).getEnclosingCallable().getLocation()
162164
}
163165

166+
/**
167+
* Get the most appropriate AST node for this control flow node, if any.
168+
*
169+
* This is needed for the equivalence relation on basic blocks in range
170+
* analysis.
171+
*/
164172
ExprParent getAstNode() {
165173
result = this.asExpr() or
166174
result = this.asStmt() or
167175
this = TExitNode(result)
168176
}
169177
}
170178

179+
/** A synthetic node for the exit of a callable. */
171180
class ExitNode extends Node, TExitNode { }
172181
}
173182

java/ql/lib/semmle/code/java/controlflow/BasicBlocks.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class BasicBlock extends ControlFlowNode {
6767
predicate bbPostDominates(BasicBlock node) { bbPostDominates(this, node) }
6868
}
6969

70+
/** A basic block that ends in an exit node. */
7071
class ExitBlock extends BasicBlock {
7172
ExitBlock() { this.getLastNode() instanceof ControlFlow::ExitNode }
7273
}

0 commit comments

Comments
 (0)