2 ** LCLint - annotation-assisted static program checker
3 ** Copyright (C) 1994-2000 University of Virginia,
4 ** Massachusetts Institute of Technology
6 ** This program is free software; you can redistribute it and/or modify it
7 ** under the terms of the GNU General Public License as published by the
8 ** Free Software Foundation; either version 2 of the License, or (at your
9 ** option) any later version.
11 ** This program is distributed in the hope that it will be useful, but
12 ** WITHOUT ANY WARRANTY; without even the implied warranty of
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 ** General Public License for more details.
16 ** The GNU General Public License is available from http://www.gnu.org/ or
17 ** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
18 ** MA 02111-1307, USA.
20 ** For information on lclint: lclint-request@cs.virginia.edu
21 ** To report a bug: lclint-bug@cs.virginia.edu
22 ** For more information: http://lclint.cs.virginia.edu
28 # include "lclintMacros.nf"
34 return (globSet_undefined);
38 globSet_clear (globSet g)
44 globSet_insert (/*@returned@*/ globSet s, sRef el)
46 if (sRef_isKnown (el) && !sRef_isConst (el) && !sRef_isType (el))
48 llassertprint (sRef_isGlobal (el) || sRef_isKindSpecial (el),
49 ("el: %s", sRef_unparse (el)));
51 return (sRefSet_insert (s, el));
60 globSet_copy (/*@returned@*/ globSet s1, /*@exposed@*/ globSet s2)
62 return (sRefSet_copy (s1, s2));
66 globSet_newCopy (globSet s)
68 return (sRefSet_newCopy (s));
72 globSet_member (globSet s, sRef el)
74 return (sRefSet_member (s, el));
77 /*@exposed@*/ sRef globSet_lookup (globSet s, sRef el)
79 sRefSet_allElements (s, e)
81 if (sRef_similar (e, el))
85 } end_sRefSet_allElements;
87 return sRef_undefined;
91 globSet_hasStatic (globSet s)
93 sRefSet_allElements (s, el)
95 if (sRef_isFileStatic (el))
99 } end_sRefSet_allElements;
105 globSet_free (/*@only@*/ globSet s)
111 globSet_dump (globSet lset)
113 cstring st = cstring_undefined;
117 sRefSet_allElements (lset, el)
121 st = cstring_appendChar (st, ',');
128 st = cstring_concatFree (st, sRef_dumpGlobal (el));
129 } end_sRefSet_allElements;
135 globSet_undump (char **s)
138 sRefSet sl = sRefSet_new ();
140 while ((c = **s) != '#' && c != '@' && c != '$' && c != '&')
142 sl = sRefSet_insert (sl, sRef_undumpGlobal (s));
155 globSet_unparse (globSet ll)
157 return (sRefSet_unparse (ll));
161 globSet_compare (globSet l1, globSet l2)
163 return (sRefSet_compare (l1, l2));