Skip to content

Commit 5ef496d

Browse files
committed
Java: Add more qldoc.
1 parent 85778f7 commit 5ef496d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

java/ql/lib/semmle/code/java/dataflow/TypeFlow.qll

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ private RefType boxIfNeeded(J::Type t) {
2121
result = t
2222
}
2323

24+
/** Provides the input types and predicates for instantiation of `UniversalFlow`. */
2425
module FlowStepsInput implements UniversalFlow::UniversalFlowInput<Location> {
2526
private newtype TFlowNode =
2627
TField(Field f) { not f.getType() instanceof PrimitiveType } or
@@ -32,28 +33,35 @@ module FlowStepsInput implements UniversalFlow::UniversalFlowInput<Location> {
3233
* A `Field`, `BaseSsaVariable`, `Expr`, or `Method`.
3334
*/
3435
class FlowNode extends TFlowNode {
36+
/** Gets a textual representation of this element. */
3537
string toString() {
3638
result = this.asField().toString() or
3739
result = this.asSsa().toString() or
3840
result = this.asExpr().toString() or
3941
result = this.asMethod().toString()
4042
}
4143

44+
/** Gets the source location for this element. */
4245
Location getLocation() {
4346
result = this.asField().getLocation() or
4447
result = this.asSsa().getLocation() or
4548
result = this.asExpr().getLocation() or
4649
result = this.asMethod().getLocation()
4750
}
4851

52+
/** Gets the field corresponding to this node, if any. */
4953
Field asField() { this = TField(result) }
5054

55+
/** Gets the SSA variable corresponding to this node, if any. */
5156
BaseSsaVariable asSsa() { this = TSsa(result) }
5257

58+
/** Gets the expression corresponding to this node, if any. */
5359
Expr asExpr() { this = TExpr(result) }
5460

61+
/** Gets the method corresponding to this node, if any. */
5562
Method asMethod() { this = TMethod(result) }
5663

64+
/** Gets the type of this node. */
5765
RefType getType() {
5866
result = this.asField().getType() or
5967
result = this.asSsa().getSourceVariable().getType() or

java/ql/lib/semmle/code/java/dataflow/internal/BaseSSA.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class BaseSsaSourceVariable extends TBaseSsaSourceVariable {
3838
/** Gets the `Callable` in which this `BaseSsaSourceVariable` is defined. */
3939
Callable getEnclosingCallable() { this = TLocalVar(result, _) }
4040

41+
/** Gets a textual representation of this element. */
4142
string toString() {
4243
exists(LocalScopeVariable v, Callable c | this = TLocalVar(c, v) |
4344
if c = v.getCallable()
@@ -46,6 +47,7 @@ class BaseSsaSourceVariable extends TBaseSsaSourceVariable {
4647
)
4748
}
4849

50+
/** Gets the source location for this element. */
4951
Location getLocation() {
5052
exists(LocalScopeVariable v | this = TLocalVar(_, v) and result = v.getLocation())
5153
}
@@ -482,8 +484,10 @@ class BaseSsaVariable extends TBaseSsaVariable {
482484
this = TSsaEntryDef(_, result)
483485
}
484486

487+
/** Gets a textual representation of this element. */
485488
string toString() { none() }
486489

490+
/** Gets the source location for this element. */
487491
Location getLocation() { result = this.getCfgNode().getLocation() }
488492

489493
/** Gets the `BasicBlock` in which this SSA variable is defined. */

0 commit comments

Comments
 (0)