+static void processVariable (idDecl t)
+{
+ uentry e;
+ ctype ct;
+
+ ct = ctype_realType (idDecl_getCtype (t));
+
+ if (s_processingParams)
+ {
+ cstring id = idDecl_getName (t);
+ int paramno = uentryList_lookupRealName (saveParamList, id);
+
+ if (paramno >= 0)
+ {
+ uentry cparam = uentryList_getN (saveParamList, paramno);
+
+ DPRINTF (("Processing param: %s", uentry_unparseFull (cparam)));
+ uentry_setType (cparam, idDecl_getCtype (t));
+ uentry_reflectQualifiers (cparam, idDecl_getQuals (t));
+ uentry_setDeclaredOnly (cparam, context_getSaveLocation ());
+ DPRINTF (("Processing param: %s", uentry_unparseFull (cparam)));
+ }
+ else
+ {
+ llfatalerrorLoc
+ (message ("Old style declaration uses unlisted parameter: %s",
+ id));
+ }
+ }
+ else
+ {
+ fileloc loc;
+
+ if (context_inIterDef ())
+ {
+ cstring pname = makeParam (idDecl_observeId (t));
+ uentry p = usymtab_lookupSafe (pname);
+
+ cstring_free (pname);
+
+ if (uentry_isYield (p))
+ {
+ e = uentry_makeParam (t, sRef_getParam (uentry_getSref (p)));
+ uentry_checkYieldParam (p, e);
+ usymtab_supEntrySref (e);
+ return;
+ }
+ }
+
+ if ((hasSpecialCode () || argsUsed)
+ && ctype_isFunction (idDecl_getCtype (t)))
+ {
+ e = uentry_makeIdFunction (t);
+ reflectSpecialCode (e);
+ reflectArgsUsed (e);
+ }
+ else
+ {
+ e = uentry_makeIdVariable (t);
+ }
+
+ loc = uentry_whereDeclared (e);
+
+ /*
+ if (context_inGlobalScope ())
+ {
+ uentry_checkParams was here!
+ }
+ */
+
+ if (ctype_isFunction (uentry_getType (e)))
+ {
+ clabstract_prepareFunction (e);
+ }
+
+ DPRINTF (("Superceding... %s", uentry_unparseFull (e)));
+ e = usymtab_supEntrySrefReturn (e);
+ DPRINTF (("After superceding... %s", uentry_unparseFull (e)));
+
+ if (uentry_isExtern (e) && !context_inGlobalScope ())
+ {
+ voptgenerror
+ (FLG_NESTEDEXTERN,
+ message ("Declaration using extern inside function scope: %q",
+ uentry_unparse (e)),
+ g_currentloc);
+
+ uentry_setDefined (e, fileloc_getExternal ());
+ sRef_setDefined (uentry_getSref (e), fileloc_getExternal ());
+ }
+
+ if (uentry_isFunction (e))
+ {
+ if (!context_inXHFile ())
+ {
+ checkParamNames (e);
+ }
+ }
+
+ if (uentry_isVar (e) && uentry_isCheckedUnknown (e))
+ {
+ sRef sr = uentry_getSref (e);
+
+ if (sRef_isLocalVar (sr))
+ {
+ if (context_getFlag (FLG_IMPCHECKMODINTERNALS))
+ {
+ uentry_setCheckMod (e);
+ }
+ else
+ {
+ uentry_setUnchecked (e);
+ }
+ }
+ else if (sRef_isFileStatic (sr))
+ {
+ if (context_getFlag (FLG_IMPCHECKEDSTRICTSTATICS))
+ {
+ uentry_setCheckedStrict (e);
+ }
+ else if (context_getFlag (FLG_IMPCHECKEDSTATICS))
+ {
+ uentry_setChecked (e);
+ }
+ else if (context_getFlag (FLG_IMPCHECKMODSTATICS))
+ {
+ uentry_setCheckMod (e);
+ }
+ else
+ {
+ ;
+ }
+ }
+ else /* real global */
+ {
+ llassert (sRef_isRealGlobal (sr));
+
+ if (context_getFlag (FLG_IMPCHECKEDSTRICTGLOBALS))
+ {
+ uentry_setCheckedStrict (e);
+ }
+ else if (context_getFlag (FLG_IMPCHECKEDGLOBALS))
+ {
+ uentry_setChecked (e);
+ }
+ else if (context_getFlag (FLG_IMPCHECKMODGLOBALS))
+ {
+ uentry_setCheckMod (e);
+ }
+ else
+ {
+ ;
+ }
+ }
+ }
+ }
+}