Skip to content

Commit

Permalink
- add comments for CFG
Browse files Browse the repository at this point in the history
  • Loading branch information
whtoo committed Nov 30, 2023
1 parent e464c3a commit 90a9db9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ep20/src/main/java/org/teachfx/antlr4/ep20/pass/cfg/CFG.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
*/
public class CFG<I extends IRNode> implements Iterable<BasicBlock<I>> {
private final static Logger logger = LogManager.getLogger(CFG.class);
// index: 第几号节点 -> BasicBlock<I> : 第几号节点对应的BasicBlock<I>节点
public final List<BasicBlock<I>> nodes;

// <from,to> : <起始节点,终止节点>
public final List<Pair<Integer, Integer>> edges;

// index: 第几号节点 -> <prev,successors> : <前驱节点的集合,后继节点的集合>
private final List<Pair<Set<Integer>, Set<Integer>>> links;

public CFG(Map<Integer, BasicBlock<I>> nodes, List<Pair<Integer, Integer>> edges) {
Expand Down

0 comments on commit 90a9db9

Please sign in to comment.