static void context_exitClausePlain (void) /*@modifies gc@*/ ;
static void context_setJustPopped (void) /*@modifies gc.justpopped@*/ ;
static void context_setValue (flagcode p_flag, int p_val) /*@modifies gc.flags@*/ ;
-static void context_setFlag (flagcode p_f, bool p_b)
+/*drl fix static */ void context_setFlag (flagcode p_f, bool p_b)
/*@modifies gc.flags@*/ ;
static void
FLG_FIRSTCASE,
FLG_NESTEDEXTERN,
FLG_NUMLITERAL,
+ FLG_ZEROBOOL,
/* memchecks flags */
FLG_NULLDEREF,
FLG_NULLSTATE, FLG_NULLASSIGN,
FLG_LONGUNSIGNEDUNSIGNEDINTEGRAL,
FLG_NUMLITERAL,
FLG_CHARINTLITERAL,
+ FLG_ZEROBOOL,
INVALID_FLAG
} ;
{
gc.acct = typeIdSet_insert (gc.acct, t);
}
-
- gc.facct = typeIdSet_insert (gc.facct, t);
-
- base = fileloc_getBase (g_currentloc);
+
+ gc.facct = typeIdSet_insert (gc.facct, t);
+
+ base = fileloc_getBase (g_currentloc);
insertModuleAccess (base, t);
-
- }
+ DPRINTF (("Add file access: %s / %s", typeIdSet_unparse (gc.facct),
+ typeIdSet_unparse (gc.acct)));
+}
void
context_removeFileAccessType (typeId t)
{
gc.acct = gc.facct;
}
-
+
+ DPRINTF (("Enter function: %s / %s", uentry_unparse (e),
+ typeIdSet_unparse (gc.acct)));
+
gc.showfunction = context_getFlag (FLG_SHOWFUNC);
gc.globs = uentry_getGlobs (e);
void
context_returnFunction (void)
{
- usymtab_checkFinalScope (TRUE);
- }
+ usymtab_checkFinalScope (TRUE);
+}
void
context_exitFunction (void)
-{
-
+{
if (!context_inFunction () && !context_inMacroConstant ()
&& !context_inMacroUnknown ()
&& !context_inIterDef () && !context_inIterEnd ())
{
if (context_inFunctionLike ())
{
- return (uentry_getParams (gc.cont.fcn));
+ return (uentry_getParams (gc.cont.fcn));
}
else
{
addModuleAccess (cstring_makeLiteral ("types"), boolt);
}
+# if 0
bool
context_canAccessBool (void)
{
+ return TRUE;
+}
+# endif
+
+/*
static typeId boolType = typeId_invalid;
-
- if (context_getFlag (FLG_ABSTRACTBOOL))
+ if (typeId_isInvalid (boolType))
+ {
+ boolType = usymtab_getTypeId (context_getBoolName ());
+ }
+
+ if (typeId_isInvalid (boolType)) {
+ return FALSE;
+ } else {
+ return (typeIdSet_member (gc.acct, boolType));
+ }
+}
+*/
+
+/* evs 2000-07-25: old version - replaced */
+
+ctype
+context_boolImplementationType () {
+ /* For now, this is bogus! */
+ return ctype_int;
+}
+
+bool
+context_canAccessBool (void)
+{
+ static typeId boolType = typeId_invalid;
+
+ if (typeId_isInvalid (boolType))
+ {
+ boolType = usymtab_getTypeId (context_getBoolName ());
+ }
+
+ if (!typeId_isInvalid (boolType))
+ {
+ return context_hasAccess (boolType);
+ }
+ else
{
- if (typeId_isInvalid (boolType))
- {
- boolType = usymtab_getTypeId (context_getBoolName ());
- }
- return (typeIdSet_member (gc.acct, boolType));
+ ;
}
- return FALSE;
+ return FALSE;
}
void
ct = ctype_makeConj (ct, ctype_voidPointer);
}
- if (!context_getFlag (FLG_ABSTRACTBOOL))
- {
- ct = ctype_makeConj (ct, ctype_bool);
- }
+ if (context_getFlag (FLG_ZEROBOOL)) {
+ ct = ctype_makeConj (ct, ctype_bool);
+ }
return ct;
}
{
cstring baseName = fileloc_getBase (g_currentloc);
- DPRINTF (("Access: %s", baseName));
-
if (context_getFlag (FLG_ACCESSFILE))
{
if (usymtab_existsType (baseName))
gc.facct = typeIdSet_insert (gc.facct,
usymtab_getTypeId (baseName));
}
+ else
+ {
+ ;
+ }
}
if (context_getFlag (FLG_ACCESSMODULE))
gc.acct = gc.facct;
gc.inheader = FALSE;
}
-
+
/* 17 Jan 1995: forgot to clear nacct */
- gc.nacct = typeIdSet_emptySet ();
- }
+ gc.nacct = typeIdSet_emptySet ();
+}
static void
context_enterFileAux (void)
(cstring_toCharsSafe (fileName (currentFile ())))));
gc.inmacrocache = TRUE;
-
- lastfl = macrocache_processFileElements (gc.mc, cbase);
+
+ DPRINTF (("Processing macros: %s", cbase));
+ lastfl = macrocache_processFileElements (gc.mc, cbase);
+ DPRINTF (("Processing macros: %s", fileloc_unparse (lastfl)));
+
cstring_free (cbase);
if (fileloc_isDefined (lastfl))
gc.library = f;
}
- gc.setGlobally[f] = TRUE;
+ gc.setGlobally[f] = TRUE;
context_setFlag (f, b);
}
}
-static void
+/*drl7x fix this static */ void
context_setFlag (flagcode f, bool b)
{
context_setFlagAux (f, b, FALSE, FALSE);
return (gc.macroMissingParams);
}
-
+void context_showFilelocStack (void)
+{
+ filelocStack_printIncludes (gc.locstack);
+}