Class PagToDotDumper


  • public class PagToDotDumper
    extends Object
    Utilities for dumping dot representations of parts of a PAG.
    Author:
    msridhar
    • Constructor Detail

      • PagToDotDumper

        public PagToDotDumper​(PAG pag)
    • Method Detail

      • makeDotNodeLabel

        public static String makeDotNodeLabel​(Node n,
                                              Predicate<Node> p)
        Generate a node declaration for a dot file.
        Parameters:
        node - the node
        p - a predicate over nodes, which, if true, will cause the node to appear red
        Returns:
        the appropriate String for the dot file
      • dumpP2SetsForLocals

        public void dumpP2SetsForLocals​(String fName,
                                        String mName)
                                 throws FileNotFoundException
        dumps the points-to sets for all locals in a method in a dot representation. The graph has edges from each local to all AllocNodes in its points-to set
        Parameters:
        fName - a name for the output file
        mName - the name of the method whose locals should be dumped
        Throws:
        FileNotFoundException - if unable to output to specified file
      • dumpPAGForMethod

        public void dumpPAGForMethod​(String fName,
                                     String cName,
                                     String mName)
                              throws FileNotFoundException
        Dump the PAG for some method in the program in dot format
        Parameters:
        fName - The filename for the output
        cName - The name of the declaring class for the method
        mName - The name of the method
        Throws:
        FileNotFoundException - if output file cannot be written
      • traceNode

        public void traceNode​(int id)
      • makeNodeName

        public static String makeNodeName​(Node n)
      • makeLabel

        public static String makeLabel​(FieldRefNode node)
        Parameters:
        node -
        Returns:
      • makeLabel

        public static String makeLabel​(VarNode base)
        Parameters:
        base -
        Returns: