2 * Copyright (c) 1996 Barton P. Miller
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.
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.
18 * (for other uses, please contact us at paradyn@cs.wisc.edu)
20 * All warranties, including without limitation, any warranty of
21 * merchantability or fitness for a particular purpose, are hereby
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.
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.
42 #ifndef _BPatch_collections_h_
43 #define _BPatch_collections_h_
45 #include "BPatch_type.h" //type and localVar
46 #include "common/h/String.h"
47 #include "common/h/Dictionary.h"
48 #include "common/h/list.h"
52 * This class contains a collection of local variables.
53 * Each function will have one of these objects associated with it.
54 * This object will store all the local variables within this function.
55 * Note: This class is unaware of scope.
57 class BPatch_localVarCollection{
59 dictionary_hash<string, BPatch_localVar *> localVariablesByName;
62 BPatch_localVarCollection(): localVariablesByName(string::hash){};
63 ~BPatch_localVarCollection();
65 void addLocalVar(BPatch_localVar * var);
66 BPatch_localVar * findLocalVar(const char *name);
67 BPatch_Vector<BPatch_localVar *> *getAllVars();
72 class BPatch_typeCollection {
73 friend class BPatch_image;
74 friend class BPatch_module;
76 dictionary_hash<string, BPatch_type *> typesByName;
77 dictionary_hash<string, BPatch_type *> globalVarsByName;
78 dictionary_hash<int, BPatch_type *> typesByID;
80 BPatch_typeCollection();
81 ~BPatch_typeCollection();
83 BPatch_type *findType(const char *name);
84 BPatch_type *findType(const int & ID);
85 void addType(BPatch_type *type);
86 void addGlobalVariable(const char *name, BPatch_type *type)
87 {globalVarsByName[name] = type;}
89 BPatch_type *findVariableType(const char *name);
94 * This class defines the collection for the built-in Types
95 * gnu ( and AIX??) use negative numbers to define other types
96 * in terms of these built-in types.
97 * This collection is global and built in the BPatch_image constructor.
98 * This means that only one collection of built-in types is made
99 * per image. jdd 4/21/99
103 class BPatch_builtInTypeCollection {
105 dictionary_hash<string, BPatch_type *> builtInTypesByName;
106 dictionary_hash<int, BPatch_type *> builtInTypesByID;
109 BPatch_builtInTypeCollection();
110 ~BPatch_builtInTypeCollection();
112 BPatch_type *findBuiltInType(const char *name);
113 BPatch_type *findBuiltInType(const int & ID);
114 void addBuiltInType(BPatch_type *type);
119 #endif /* _BPatch_collections_h_ */