Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor CFG to separate instructions from CFGs; this is to allow cod…
…e like CDGs to be reused without an IR.
- Loading branch information
1 parent
9b58450
commit f3b5d41
Showing
7 changed files
with
78 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2007 IBM Corporation. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* IBM Corporation - initial API and implementation | ||
*******************************************************************************/ | ||
package com.ibm.wala.cfg; | ||
|
||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
import com.ibm.wala.util.graph.NumberedGraph; | ||
|
||
public interface MinimalCFG<T> extends NumberedGraph<T> { | ||
|
||
/** | ||
* Return the entry basic block in the CFG | ||
*/ | ||
public T entry(); | ||
|
||
/** | ||
* @return the synthetic exit block for the cfg | ||
*/ | ||
public T exit(); | ||
|
||
/** | ||
* The order of blocks returned must indicate the exception-handling scope. So the first block is the first candidate catch block, | ||
* and so on. With this invariant one can compute the exceptional control flow for a given exception type. | ||
* | ||
* @return the basic blocks which may be reached from b via exceptional control flow | ||
*/ | ||
public List<T> getExceptionalSuccessors(T b); | ||
|
||
/** | ||
* The order of blocks returned should be arbitrary but deterministic. | ||
* | ||
* @return the basic blocks which may be reached from b via normal control flow | ||
*/ | ||
public Collection<T> getNormalSuccessors(T b); | ||
|
||
/** | ||
* The order of blocks returned should be arbitrary but deterministic. | ||
* | ||
* @return the basic blocks from which b may be reached via exceptional control flow | ||
*/ | ||
public Collection<T> getExceptionalPredecessors(T b); | ||
|
||
/** | ||
* The order of blocks returned should be arbitrary but deterministic. | ||
* | ||
* @return the basic blocks from which b may be reached via normal control flow | ||
*/ | ||
public Collection<T> getNormalPredecessors(T b); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
com.ibm.wala.util/src/com/ibm/wala/util/graph/labeled/NumberedLabeledGraph.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.ibm.wala.util.graph.labeled; | ||
|
||
import com.ibm.wala.util.graph.NumberedGraph; | ||
|
||
public interface NumberedLabeledGraph<T, I> extends NumberedGraph<T>, NumberedLabeledEdgeManager<T,I> { | ||
|
||
} |