Package de.fraunhofer.aisec.cpg.passes
Class ControlFlowGraphPass
- java.lang.Object
-
- de.fraunhofer.aisec.cpg.passes.Pass
-
- de.fraunhofer.aisec.cpg.passes.ControlFlowGraphPass
-
- All Implemented Interfaces:
java.util.function.Consumer<TranslationResult>
public class ControlFlowGraphPass extends Pass
Creates a simple control flow graph (CFG) based on AST.The CFG is a directed cyclic graph with Node representing statements and edges representing the program control flow.
- Return statements will have no successors.
- Branch statements (if/switch/exception traps) will have multiple successors.
- Simple statements will have their following statement as sole successor
- break / continue will create respective edges
-
-
Constructor Summary
Constructors Constructor Description ControlFlowGraphPass()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(TranslationResult t)voidaddTodo(int index, Statement... statements)Adds statements to this.remaining, omitting null.voidaddTodo(int index, java.util.List<Statement> stmts)voidcleanup()-
Methods inherited from class de.fraunhofer.aisec.cpg.passes.Pass
getLang, setLang, supportsLanguageFrontend
-
-
-
-
Method Detail
-
accept
public void accept(TranslationResult t)
-
addTodo
public void addTodo(int index, java.util.List<Statement> stmts)
-
addTodo
public void addTodo(int index, Statement... statements)Adds statements to this.remaining, omitting null.- Parameters:
index- the indexstatements- the statements to add
-
-