make a few private methods protected, so subclasses may override
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3335 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
22f74154da
commit
cc967ff9ae
|
@ -37,9 +37,6 @@ import com.ibm.wala.util.warnings.Warnings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A graph of basic blocks.
|
* A graph of basic blocks.
|
||||||
*
|
|
||||||
* @author sfink
|
|
||||||
* @author roca
|
|
||||||
*/
|
*/
|
||||||
public class ShrikeCFG extends AbstractCFG<IInstruction, ShrikeCFG.BasicBlock> {
|
public class ShrikeCFG extends AbstractCFG<IInstruction, ShrikeCFG.BasicBlock> {
|
||||||
|
|
||||||
|
@ -254,7 +251,7 @@ public class ShrikeCFG extends AbstractCFG<IInstruction, ShrikeCFG.BasicBlock> {
|
||||||
*
|
*
|
||||||
* @param last the last instruction in a basic block.
|
* @param last the last instruction in a basic block.
|
||||||
*/
|
*/
|
||||||
private void addExceptionalEdges(IInstruction last) {
|
protected void addExceptionalEdges(IInstruction last) {
|
||||||
IClassHierarchy cha = getMethod().getClassHierarchy();
|
IClassHierarchy cha = getMethod().getClassHierarchy();
|
||||||
if (last.isPEI()) {
|
if (last.isPEI()) {
|
||||||
Collection<TypeReference> exceptionTypes = null;
|
Collection<TypeReference> exceptionTypes = null;
|
||||||
|
|
|
@ -38,13 +38,7 @@ import com.ibm.wala.util.intset.MutableIntSet;
|
||||||
import com.ibm.wala.viz.IFDSExplorer;
|
import com.ibm.wala.viz.IFDSExplorer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Interprocedural control-flow graph, constructed lazily.
|
* Interprocedural control-flow graph, constructed lazily.
|
||||||
*
|
|
||||||
*
|
|
||||||
* @author sfink
|
|
||||||
* @author Julian Dolby
|
|
||||||
* @author Manu Sridharan
|
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractInterproceduralCFG<T extends ISSABasicBlock> implements NumberedGraph<BasicBlockInContext<T>> {
|
public abstract class AbstractInterproceduralCFG<T extends ISSABasicBlock> implements NumberedGraph<BasicBlockInContext<T>> {
|
||||||
|
|
||||||
|
@ -160,8 +154,7 @@ public abstract class AbstractInterproceduralCFG<T extends ISSABasicBlock> imple
|
||||||
* @param instrs the instructions for node n
|
* @param instrs the instructions for node n
|
||||||
* @param bb a basic block in the CFG
|
* @param bb a basic block in the CFG
|
||||||
*/
|
*/
|
||||||
private void addEdgesToNonEntryBlock(CGNode n, ControlFlowGraph<?, T> cfg, SSAInstruction[] instrs, T bb) {
|
protected void addEdgesToNonEntryBlock(CGNode n, ControlFlowGraph<?, T> cfg, SSAInstruction[] instrs, T bb) {
|
||||||
|
|
||||||
if (DEBUG_LEVEL > 1) {
|
if (DEBUG_LEVEL > 1) {
|
||||||
System.err.println("addEdgesToNonEntryBlock: " + bb);
|
System.err.println("addEdgesToNonEntryBlock: " + bb);
|
||||||
System.err.println("nPred: " + cfg.getPredNodeCount(bb));
|
System.err.println("nPred: " + cfg.getPredNodeCount(bb));
|
||||||
|
@ -188,37 +181,6 @@ public abstract class AbstractInterproceduralCFG<T extends ISSABasicBlock> imple
|
||||||
System.err.println("Last instruction is : " + inst);
|
System.err.println("Last instruction is : " + inst);
|
||||||
}
|
}
|
||||||
if (inst instanceof SSAAbstractInvokeInstruction) {
|
if (inst instanceof SSAAbstractInvokeInstruction) {
|
||||||
// a previous instruction is a call instruction. If necessary,
|
|
||||||
// add an edge from the exit() of each target of the call.
|
|
||||||
// IInvokeInstruction call = (IInvokeInstruction) inst;
|
|
||||||
// CallSiteReference site = makeCallSiteReference(n.getMethod().getDeclaringClass().getClassLoader().getReference(), cfg
|
|
||||||
// .getProgramCounter(index), call);
|
|
||||||
// if (DEBUG_LEVEL > 1) {
|
|
||||||
// System.err.println("got Site: " + site);
|
|
||||||
// }
|
|
||||||
// boolean irrelevantTargets = false;
|
|
||||||
// for (Iterator ts = cg.getPossibleTargets(n, site).iterator(); ts.hasNext();) {
|
|
||||||
// CGNode tn = (CGNode) ts.next();
|
|
||||||
// if (!relevant.accepts(tn)) {
|
|
||||||
// if (DEBUG_LEVEL > 1) {
|
|
||||||
// System.err.println("Irrelevant target: " + tn);
|
|
||||||
// }
|
|
||||||
// irrelevantTargets = true;
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (DEBUG_LEVEL > 1) {
|
|
||||||
// System.err.println("Relevant target: " + tn);
|
|
||||||
// }
|
|
||||||
// // add an edge from tn exit to this node
|
|
||||||
// ControlFlowGraph<? extends T> tcfg = getCFG(tn);
|
|
||||||
// // tcfg might be null if tn is an unmodelled native method
|
|
||||||
// if (tcfg != null) {
|
|
||||||
// addEdgesFromExitToReturn(n, bb, tn, tcfg);
|
|
||||||
// addEdgesFromCallToEntry(n, pb, tn, tcfg);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (CALL_TO_RETURN_EDGES) {
|
if (CALL_TO_RETURN_EDGES) {
|
||||||
// Add a "normal" edge from the predecessor block to this block.
|
// Add a "normal" edge from the predecessor block to this block.
|
||||||
BasicBlockInContext<T> p = new BasicBlockInContext<T>(n, pb);
|
BasicBlockInContext<T> p = new BasicBlockInContext<T>(n, pb);
|
||||||
|
|
Loading…
Reference in New Issue