diff options
Diffstat (limited to 'org.eclipse.ptp.pldt.mpi.analysis.cdt/src/org/eclipse/ptp/pldt/mpi/analysis/cdt/graphs/impl/Block.java')
-rw-r--r-- | org.eclipse.ptp.pldt.mpi.analysis.cdt/src/org/eclipse/ptp/pldt/mpi/analysis/cdt/graphs/impl/Block.java | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/org.eclipse.ptp.pldt.mpi.analysis.cdt/src/org/eclipse/ptp/pldt/mpi/analysis/cdt/graphs/impl/Block.java b/org.eclipse.ptp.pldt.mpi.analysis.cdt/src/org/eclipse/ptp/pldt/mpi/analysis/cdt/graphs/impl/Block.java index db76c50..ccaaec2 100644 --- a/org.eclipse.ptp.pldt.mpi.analysis.cdt/src/org/eclipse/ptp/pldt/mpi/analysis/cdt/graphs/impl/Block.java +++ b/org.eclipse.ptp.pldt.mpi.analysis.cdt/src/org/eclipse/ptp/pldt/mpi/analysis/cdt/graphs/impl/Block.java @@ -1,5 +1,5 @@ /********************************************************************** - * Copyright (c) 2007 IBM Corporation. + * Copyright (c) 2007, 2009 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 @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Elliott Baron - fixed print issue *******************************************************************************/ package org.eclipse.ptp.pldt.mpi.analysis.cdt.graphs.impl; @@ -21,6 +22,7 @@ import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IASTNode; import org.eclipse.cdt.core.dom.ast.IASTStatement; import org.eclipse.ptp.pldt.mpi.analysis.cdt.graphs.IBlock; +import org.eclipse.ptp.pldt.mpi.analysis.cdt.graphs.IControlFlowEdge; /** * @@ -30,6 +32,8 @@ import org.eclipse.ptp.pldt.mpi.analysis.cdt.graphs.IBlock; public class Block implements IBlock { protected List<IBlock> succs_; protected List<IBlock> preds_; + protected List<IControlFlowEdge> inEdges_; + protected List<IControlFlowEdge> outEdges_; protected IBlock topNext_ = null; protected IBlock botNext_ = null; protected List<IBlock> DOM_ = null; @@ -105,6 +109,8 @@ public class Block implements IBlock { protected void blockInit(){ succs_ = new ArrayList<IBlock>(); preds_ = new ArrayList<IBlock>(); + inEdges_ = new ArrayList<IControlFlowEdge>(); + outEdges_ = new ArrayList<IControlFlowEdge>(); DOM_ = new ArrayList<IBlock>(); PDOM_ = new ArrayList<IBlock>(); attrs_ = new Hashtable<String,Object>(); @@ -193,6 +199,22 @@ public class Block implements IBlock { return succs_; } + public IControlFlowEdge[] getInEdges() { + return inEdges_.toArray(new IControlFlowEdge[inEdges_.size()]); + } + + public void addInEdge(IControlFlowEdge edge) { + inEdges_.add(edge); + } + + public IControlFlowEdge[] getOutEdges() { + return outEdges_.toArray(new IControlFlowEdge[outEdges_.size()]); + } + + public void addOutEdge(IControlFlowEdge edge) { + outEdges_.add(edge); + } + public List<IBlock> getDOM(){ return DOM_; } |