summaryrefslogtreecommitdiffstats
path: root/org.eclipse.ptp.pldt.mpi.analysis.cdt/src/org/eclipse/ptp/pldt/mpi/analysis/cdt/graphs/ICallGraphNode.java
blob: 3574662335708a292e858d94965c59454494b321 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/**********************************************************************
 * 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 org.eclipse.ptp.pldt.mpi.analysis.cdt.graphs;

import java.util.List;

import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
import org.eclipse.core.resources.IResource;

/**
 * A call graph node corresponds to a user-defined function.
 * 
 * @author Yuan Zhang
 *
 */
public interface ICallGraphNode {
	
	/**
	 * @return the function name
	 */
	public String getFuncName();
	
	/**
	 * @return the enclosing file name
	 */
	public String getFileName();
	
	public IResource getResource();
	
	/**
	 * @return the function declaration
	 */
	public IASTFunctionDefinition getFuncDef();
	
	/**
	 * @return the set of functions that call this function
	 */
	public List<ICallGraphNode> getCallers();
	public void addCaller(ICallGraphNode caller);
	
	/**
	 * @return the set of functions that are called by this function
	 */
	public List<ICallGraphNode>	getCallees();
	public void addCallee(ICallGraphNode callee);

	/**
	 * @return the control flow graph of this function
	 */
	public IControlFlowGraph getCFG();
	public void setCFG(IControlFlowGraph cfg);
	
	/**
	 * @return the next function according to the topological order
	 */
	public ICallGraphNode topNext();
	public void setTopNext(ICallGraphNode node);
	
	/**
	 * @return the next function according to the reverse topological order
	 */
	public ICallGraphNode botNext();
	public void setBotNext(ICallGraphNode node);
	
	public void setAttr(String name, Object attr);
	public Object getAttr(String name);
	public void removeAttr(String name);
	
	public void setRecursive(boolean val);
	public boolean isRecursive();
}