Skip to content

Commit

Permalink
Comment changes (#6700)
Browse files Browse the repository at this point in the history
  • Loading branch information
mernst authored and erfan-arvan committed Jul 10, 2024
1 parent 1d5fb60 commit 217ba50
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,10 @@ protected boolean updateNodeValues(Node node, TransferResult<V, S> transferResul
* @param b the block to add to {@link #worklist}
*/
protected void addToWorklist(Block b) {
// TODO: use a more efficient way to check if b is already present
// TODO: This costs linear (!) time. Use a more efficient way to check if b is already present.
// Two possibilities:
// * add unconditionally, and detect duplicates when removing from the queue.
// * maintain a HashSet of the elements that are already in the queue.
if (!worklist.contains(b)) {
worklist.add(b);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
/**
* {@code TransferInput} is used as the input type of the individual transfer functions of a {@link
* ForwardTransferFunction} or a {@link BackwardTransferFunction}. It also contains a reference to
* the node for which the transfer function will be applied.
* the node to which the transfer function will be applied.
*
* <p>A {@code TransferInput} contains one or two stores. If two stores are present, one belongs to
* 'then', and the other to 'else'.
* "then", and the other to "else".
*
* @param <V> type of the abstract value that is tracked
* @param <S> the store type used in the analysis
Expand All @@ -36,12 +36,12 @@ public class TransferInput<V extends AbstractValue<V>, S extends Store<S>> imple
protected final @Nullable S store;

/**
* The 'then' result store (or {@code null} if none is present). See invariant at {@link #store}.
* The "then" result store (or {@code null} if none is present). See invariant at {@link #store}.
*/
protected final @Nullable S thenStore;

/**
* The 'else' result store (or {@code null} if none is present). See invariant at {@link #store}.
* The "else" result store (or {@code null} if none is present). See invariant at {@link #store}.
*/
protected final @Nullable S elseStore;

Expand All @@ -64,8 +64,8 @@ public long getUid(@UnknownInitialization TransferInput<V, S> this) {
*
* @param node the corresponding node
* @param store the regular result store, or {@code null} if none is present
* @param thenStore the 'then' result store, or {@code null} if none is present
* @param elseStore the 'else' result store, or {@code null} if none is present
* @param thenStore the "then" result store, or {@code null} if none is present
* @param elseStore the "else" result store, or {@code null} if none is present
* @param analysis analysis the corresponding analysis class to get intermediate flow results
*/
private TransferInput(
Expand Down Expand Up @@ -166,7 +166,7 @@ protected TransferInput(TransferInput<V, S> from) {
}

/**
* Returns the abstract value of node {@code n}, which is required to be a 'sub-node' (that is, a
* Returns the abstract value of node {@code n}, which is required to be a "sub-node" (that is, a
* direct or indirect child) of the node this transfer input is associated with. Furthermore,
* {@code n} cannot be a l-value node. Returns {@code null} if no value is available.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2439,6 +2439,7 @@ protected void addAnnotationsFromDefaultForType(
@FormatMethod
private static void log(String format, Object... args) {
if (debug) {
System.out.flush();
SystemPlume.sleep(1); // logging can interleave with typechecker output
System.out.printf(format, args);
}
Expand Down

0 comments on commit 217ba50

Please sign in to comment.