Adding BPatch_dependenceGraphNode and -Edge to represent graphs used in slicing
[dyninst.git] / dyninstAPI / h / BPatch_dependenceGraphNode.h
1 /*
2  * Copyright (c) 1996-2004 Barton P. Miller
3  * 
4  * We provide the Paradyn Parallel Performance Tools (below
5  * described as "Paradyn") on an AS IS basis, and do not warrant its
6  * validity or performance.  We reserve the right to update, modify,
7  * or discontinue this software at any time.  We shall have no
8  * obligation to supply such updates or modifications or any other
9  * form of support to you.
10  * 
11  * This license is for research uses.  For such uses, there is no
12  * charge. We define "research use" to mean you may freely use it
13  * inside your organization for whatever purposes you see fit. But you
14  * may not re-distribute Paradyn or parts of Paradyn, in any form
15  * source or binary (including derivatives), electronic or otherwise,
16  * to any other organization or entity without our permission.
17  * 
18  * (for other uses, please contact us at paradyn@cs.wisc.edu)
19  * 
20  * All warranties, including without limitation, any warranty of
21  * merchantability or fitness for a particular purpose, are hereby
22  * excluded.
23  * 
24  * By your use of Paradyn, you understand and agree that we (or any
25  * other person or entity with proprietary rights in Paradyn) are
26  * under no obligation to provide either maintenance services,
27  * update services, notices of latent defects, or correction of
28  * defects for Paradyn.
29  * 
30  * Even if advised of the possibility of such damages, under no
31  * circumstances shall we (or any other person or entity with
32  * proprietary rights in the software licensed hereunder) be liable
33  * to you or any third party for direct, indirect, or consequential
34  * damages of any character regardless of type of action, including,
35  * without limitation, loss of profits, loss of use, loss of good
36  * will, or computer failure or malfunction.  You agree to indemnify
37  * us (and any other person or entity with proprietary rights in the
38  * software licensed hereunder) for any and all liability it may
39  * incur to third parties resulting from your use of Paradyn.
40  */
41
42 #ifndef _BPatch_dependenceGraphNode_h_
43 #define _BPatch_dependenceGraphNode_h_
44
45 #include "BPatch_instruction.h"
46 #include "BPatch_Vector.h"
47 #include "BPatch_eventLock.h"
48 //#include "BPatch_dependenceGraphEdge.h"
49
50 class BPatch_dependenceGraphEdge;
51
52 #ifdef DYNINST_CLASS_NAME
53 #undef DYNINST_CLASS_NAME
54 #endif
55 #define DYNINST_CLASS_NAME BPatch_dependenceGraphNode
56
57 class BPATCH_DLL_EXPORT BPatch_dependenceGraphNode: public BPatch_eventLock {
58
59
60   BPatch_instruction* bpinst;
61   BPatch_Vector<BPatch_dependenceGraphEdge*>* incoming;
62   BPatch_Vector<BPatch_dependenceGraphEdge*>* outgoing;
63
64  public:
65   BPatch_Vector<BPatch_dependenceGraphEdge*>* inter;
66
67   // BPatch_dependenceGraphNode::BPatch_dependenceGraphNode
68   //
69   // constructor
70
71   API_EXPORT_CTOR(Int,(inst),
72   BPatch_dependenceGraphNode,(BPatch_instruction* inst));
73
74   API_EXPORT_CTOR(Int,(inst,incList,outList),
75   BPatch_dependenceGraphNode,(BPatch_instruction* inst,BPatch_Vector<BPatch_dependenceGraphEdge*>* incList,BPatch_Vector<BPatch_dependenceGraphEdge*>* outList));
76
77   API_EXPORT_V(Int,(out),
78   void, getOutgoingEdges,(BPatch_Vector<BPatch_dependenceGraphEdge*>& out))
79   
80   API_EXPORT_V(Int,(inc),
81   void, getIncomingEdges,(BPatch_Vector<BPatch_dependenceGraphEdge*>& inc))
82
83   API_EXPORT(Int,(other_node),
84   bool,isImmediateSuccessor,(BPatch_instruction * other_node));
85
86   API_EXPORT(Int,(other_node),
87   bool,isImmediatePredecessor,(BPatch_instruction * other_node));
88
89   API_EXPORT(Int,(),
90   BPatch_instruction*,getBPInstruction,());
91
92   bool addToIncoming(BPatch_dependenceGraphNode* other_instruction);
93
94   bool addToOutgoing(BPatch_dependenceGraphNode* other_instruction);
95 };
96 #endif // _BPatch_dependenceGraphNode_h_
97