Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

globSet.c File Reference

#include "lclintMacros.nf"
#include "basic.h"

Go to the source code of this file.

Functions

globSet globSet_new ()
void globSet_clear (globSet g)
globSet globSet_insert ( globSet s, sRef el)
globSet globSet_copy ( globSet s1, globSet s2)
globSet globSet_newCopy (globSet s)
bool globSet_member (globSet s, sRef el)
sRef globSet_lookup (globSet s, sRef el)
bool globSet_hasStatic (globSet s)
void globSet_free ( globSet s)
cstring globSet_dump (globSet lset)
globSet globSet_undump (char **s)
cstring globSet_unparse (globSet ll)
int globSet_compare (globSet l1, globSet l2)


Function Documentation

void globSet_clear ( globSet g )
 

Definition at line 38 of file globSet.c.

Referenced by context_enterConstantMacro(), context_enterFunction(), context_exitFunction(), and context_quietExitFunction().

00039 {
00040   sRefSet_clear (g);
00041 }

int globSet_compare ( globSet l1,
globSet l2 )
 

Definition at line 161 of file globSet.c.

00162 {
00163   return (sRefSet_compare (l1, l2));
00164 }

globSet globSet_copy ( globSet s1,
globSet s2 )
 

Definition at line 60 of file globSet.c.

00061 {
00062   return (sRefSet_copy (s1, s2));
00063 }

cstring globSet_dump ( globSet lset )
 

Definition at line 111 of file globSet.c.

00112 {
00113   cstring st = cstring_undefined;
00114   bool first = TRUE;
00115 
00116   
00117   sRefSet_allElements (lset, el)
00118     {
00119       if (!first)
00120         {
00121           st = cstring_appendChar (st, ',');
00122         }
00123       else
00124         {
00125           first = FALSE;
00126         }
00127 
00128       st = cstring_concatFree (st, sRef_dumpGlobal (el));
00129     } end_sRefSet_allElements;
00130 
00131   return st;
00132 }

void globSet_free ( globSet s )
 

Definition at line 105 of file globSet.c.

Referenced by context_destroyMod().

00106 {
00107   sRefSet_free (s);
00108 }

bool globSet_hasStatic ( globSet s )
 

Definition at line 91 of file globSet.c.

Referenced by uentry_setGlobals().

00092 {
00093   sRefSet_allElements (s, el)
00094     {
00095       if (sRef_isFileStatic (el))
00096         {
00097           return TRUE;
00098         }
00099     } end_sRefSet_allElements;
00100 
00101   return FALSE;
00102 }

globSet globSet_insert ( globSet s,
sRef el )
 

Definition at line 44 of file globSet.c.

Referenced by context_usedGlobal(), globListAdd(), and processNamedDecl().

00045 {
00046   if (sRef_isKnown (el) && !sRef_isConst (el) && !sRef_isType (el))
00047     {
00048       llassertprint (sRef_isGlobal (el) || sRef_isKindSpecial (el),
00049                      ("el: %s", sRef_unparse (el)));
00050       
00051       return (sRefSet_insert (s, el));
00052     }
00053   else
00054     {
00055       return s;
00056     }
00057 }

sRef globSet_lookup ( globSet s,
sRef el )
 

Definition at line 77 of file globSet.c.

00078 {
00079   sRefSet_allElements (s, e)
00080     {
00081       if (sRef_similar (e, el))
00082         {
00083           return e;
00084         }
00085     } end_sRefSet_allElements;
00086 
00087   return sRef_undefined;
00088 }

bool globSet_member ( globSet s,
sRef el )
 

Definition at line 72 of file globSet.c.

Referenced by context_globAccess(), context_usedGlobal(), exprChecks_checkUsedGlobs(), and usymtab_checkFinalScope().

00073 {
00074   return (sRefSet_member (s, el));
00075 }

globSet globSet_new ( )
 

Definition at line 32 of file globSet.c.

Referenced by context_exitFunction(), context_initMod(), and context_quietExitFunction().

00033 {
00034   return (globSet_undefined);
00035 }

globSet globSet_newCopy ( globSet s )
 

Definition at line 66 of file globSet.c.

00067 {
00068   return (sRefSet_newCopy (s));
00069 }

globSet globSet_undump ( char ** s )
 

Definition at line 135 of file globSet.c.

Referenced by uentry_undump().

00136 {
00137   char c;
00138   sRefSet sl = sRefSet_new ();
00139 
00140   while ((c = **s) != '#' && c != '@' && c != '$' && c != '&')
00141     {
00142       sl = sRefSet_insert (sl, sRef_undumpGlobal (s));
00143 
00144       
00145       if (**s == ',')
00146         {
00147           (*s)++;
00148         }
00149     }
00150 
00151     return sl;
00152 }

cstring globSet_unparse ( globSet ll )
 

Definition at line 155 of file globSet.c.

Referenced by uentry_unparseFull().

00156 {
00157   return (sRefSet_unparse (ll));
00158 }


Generated at Fri Nov 3 18:57:59 2000 for LCLint by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000