Search in sources :

Example 1 with CFGCallgraphBuilder

use of com.jopdesign.common.code.CFGCallgraphBuilder in project jop by jop-devel.

the class WCETTool method rebuildCallGraph.

/**
     * Rebuild the WCET callgraph, starting at the target method.
     * The new callgraph will be based on (but not backed by) the AppInfo callgraph, if available.
     *
     * @return the new callgraph.
     */
public CallGraph rebuildCallGraph() {
    /* This would be the ideal solution, but this way the root
    	 * does NOT have an empty callstring
    	 */
    // callGraph = appInfo.getCallGraph().getSubGraph(projectConfig.getTargetMethodInfo());
    /* Instead, we create a new "subgraph" based on the appInfo callgraph (which has been created using
         * DFA results if available in initialize() or by some other tool), where the target method has an empty
         * callstring, using the callstring length configured for the WCET tool (which is currently the same
         * as the global setting).
         */
    DefaultCallgraphBuilder callGraphBuilder = new CFGCallgraphBuilder(getCallstringLength());
    // we do not want natives in the callgraph
    callGraphBuilder.setSkipNatives(true);
    callGraph = CallGraph.buildCallGraph(getTargetMethod(), callGraphBuilder);
    try {
        callGraph.checkAcyclicity();
    } catch (AppInfoException e) {
        throw new AssertionError(e);
    }
    return callGraph;
}
Also used : CFGCallgraphBuilder(com.jopdesign.common.code.CFGCallgraphBuilder) DefaultCallgraphBuilder(com.jopdesign.common.code.DefaultCallgraphBuilder) AppInfoException(com.jopdesign.common.misc.AppInfoException)

Aggregations

CFGCallgraphBuilder (com.jopdesign.common.code.CFGCallgraphBuilder)1 DefaultCallgraphBuilder (com.jopdesign.common.code.DefaultCallgraphBuilder)1 AppInfoException (com.jopdesign.common.misc.AppInfoException)1