Computer Science, asked by mishraadarsh2244, 11 hours ago

give any one idea how to use sdg in a java program SDG ​

Answers

Answered by shreyasengupta1862
0

 public static SDG convert(SDGBuilder b, IProgressMonitor progress) throws CancelException {

   SDG sdg = new SDG(PrettyWalaNames.methodName(b.getEntry()));

   progress.subTask("Building utility edges");

   addUtilityEdges(b);

   progress.worked(1);

   MonitorUtil.throwExceptionIfCanceled(progress);

   progress.done();

   progress.subTask("Sorting all nodes by their id");

   PDGNode allNodes[] = getAllNodesSorted(b, progress);

   progress.done();

   progress.subTask("Inserting " + allNodes.length + " nodes");

   Map<PDGNode, SDGNode> pdg2sdg = convertNodes(sdg, allNodes, b, progress);

   progress.done();

   progress.subTask("Inserting edges for " + allNodes.length + " nodes");

   for (int i = 0; i < allNodes.length; i++) {

     addEdgesForNode(sdg, allNodes[i], pdg2sdg, b);

     if (i % 100 == 0) {

       progress.worked(1);

       MonitorUtil.throwExceptionIfCanceled(progress);

     }

   }

   sdg.setNode2Instr(b.getPDGNode2IIndex());

   sdg.setEntryToCGNode(b.getEntryNode2CGNode());

   progress.done();

   return sdg;

 }

Hope it helps you :)

Pls mark brainliest :D

Similar questions