Skip to content
ControlFlowArc.java 1.14 KiB
Newer Older
Javier Costa's avatar
Javier Costa committed
package tfm.arcs.cfg;
Javier Costa's avatar
Javier Costa committed

Carlos Galindo's avatar
Carlos Galindo committed
import org.jgrapht.io.Attribute;
import org.jgrapht.io.DefaultAttribute;
Javier Costa's avatar
Javier Costa committed
import tfm.arcs.Arc;
import tfm.graphs.augmented.ACFG;
Javier Costa's avatar
Javier Costa committed

Carlos Galindo's avatar
Carlos Galindo committed
import java.util.Map;

 * An edge of the {@link tfm.graphs.CFG}, representing the direct
 * flow of control. It connects two instructions if, when the source
 * is executed, one of the possible next instructions is the destination.
 */
Javier Costa's avatar
Javier Costa committed
public class ControlFlowArc extends Arc {
     * Represents a non-executable control flow arc, used within the {@link ACFG ACFG}.
     * Initially it had the following meaning: connecting a statement with
     * the following one as if the source was a {@code nop} command (no operation).
     * <br/>
     * It is used to improve control dependence, and it should be skipped when
     * computing data dependence and other analyses.
     */
Carlos Galindo's avatar
Carlos Galindo committed
    public static final class NonExecutable extends ControlFlowArc {
        @Override
        public Map<String, Attribute> getDotAttributes() {
            Map<String, Attribute> map = super.getDotAttributes();
            map.put("style", DefaultAttribute.createAttribute("dashed"));
            return map;
Javier Costa's avatar
Javier Costa committed
}