Example #1
0
        private static void Test(FunctionDefinition func)
        {
            CFGNodeFactory factory     = new CFGNodeFactory();
            FunctionCFG    functionCFG = CFGBuilder.BuildFunctionCFG(factory, func);

            PrintCFG(functionCFG.Entry);
        }
Example #2
0
        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);
        }
Example #3
0
 private CFGBuilder(CFGNodeFactory factory, FunctionCFG currentCFG)
 {
     this.factory     = factory;
     this.currentCFG  = currentCFG;
     this.currentNode = currentCFG.Entry;
 }