private static void Test(FunctionDefinition func) { CFGNodeFactory factory = new CFGNodeFactory(); FunctionCFG functionCFG = CFGBuilder.BuildFunctionCFG(factory, func); PrintCFG(functionCFG.Entry); }
public static FunctionCFG BuildFunctionCFG(CFGNodeFactory factory, FunctionDefinition func) { FunctionCFG CFG = new FunctionCFG(); CFG.Entry = factory.MakeNode(); CFG.Exit = factory.MakeNode(); CFGBuilder builder = new CFGBuilder(factory, CFG); builder.AppendControlFlow(func); ConnectControlFlow(builder.currentNode, CFG.Exit); return(CFG); }
private CFGBuilder(CFGNodeFactory factory, FunctionCFG currentCFG) { this.factory = factory; this.currentCFG = currentCFG; this.currentNode = currentCFG.Entry; }