// creates a class of the given class CFG (IMPORTANT: it means that it // updates the existing class, not creating a new one) public void createClassFromCfg(ClassCfg classCfg) { NamespaceTypeDefinition targetClass = classCfg.classObj; foreach (MethodCfg methodCfg in classCfg.methodCfgs) { // ignore method if it is external if (methodCfg.method.IsExternal) { continue; } logger.writeLine("Create method from CFG for \"" + methodCfg.method.ToString() + "\""); createMethodFromCfg(methodCfg); logger.writeLine(""); } }
// builds a CFG for the given class (means a CFG for all methods of this class) and returns it public ClassCfg buildCfgForClass(NamespaceTypeDefinition targetClass) { ClassCfg classCfg = new ClassCfg(); classCfg.classObj = targetClass; if (targetClass.Methods != null) { foreach (MethodDefinition method in targetClass.Methods) { // ignore method if it is external if (method.IsExternal) { continue; } logger.writeLine("Create CFG for method \"" + method.ToString() + "\""); classCfg.methodCfgs.Add(buildCfgForMethod(method)); logger.writeLine(""); } } return classCfg; }