#include "lclintMacros.nf"#include "llbasic.h"#include "usymtab_interface.h"#include "exprChecks.h"#include "filelocStack.h"#include "fileIdList.h"#include "llmain.h"#include "intSet.h"#include "osd.h"#include "portab.h"Go to the source code of this file.
|
|
Initializer: \
do { if (inFile) { gc.setLocally[ff] = TRUE; \
context_addFlagMarker (ff, ynm_fromBool (b)); } \
DPRINTF (("set flag: %s / %s", flagcode_name (ff), bool_unparse (b))); \
gc.flags[ff] = b; } while (FALSE) |
|
|
Initializer: \
{ int i = 0; while (modeflags[i] != INVALID_FLAG) { \
if (!flagcode_isModeFlag (modeflags[i])) \
{ llbug (message ("not a mode flag: %s", \
flagcode_unparse (modeflags[i]))); } \
else { context_setFlag (modeflags[i], TRUE); } i++; }}Definition at line 859 of file context.c. Referenced by context_setMode(). |
|
|
Definition at line 59 of file context.c. 00059 {
00060 CX_GLOBAL, CX_INNER,
00061 CX_FUNCTION, CX_FCNDECL,
00062 CX_MACROFCN, CX_MACROCONST, CX_UNKNOWNMACRO,
00063 CX_ITERDEF, CX_ITEREND,
00064 CX_LCL, CX_LCLLIB
00065 }
|
|
|
Definition at line 2317 of file context.c. Referenced by usymtab_initBool(). 02318 {
02319 cstring bname = context_getString (FLG_BOOLTYPE);
02320 typeIdSet boolt = typeIdSet_single (usymtab_getTypeId (bname));
02321
02322 addModuleAccess (cstring_copy (bname), boolt);
02323
02324 /* for sys/types (perhaps, this is bogus!) */
02325 addModuleAccess (cstring_makeLiteral ("types"), boolt);
02326 }
|
|
|
Definition at line 252 of file context.c. 00253 {
00254 macrocache_addComment (gc.mc, fileloc_copy (g_currentloc), def);
00255 }
|
|
|
Definition at line 1287 of file context.c. Referenced by usymtab_supAbstractTypeEntry(). 01288 {
01289 cstring base;
01290
01291 if (gc.kind == CX_FUNCTION || gc.kind == CX_MACROFCN
01292 || gc.kind == CX_UNKNOWNMACRO)
01293 {
01294 gc.acct = typeIdSet_insert (gc.acct, t);
01295 }
01296
01297 gc.facct = typeIdSet_insert (gc.facct, t);
01298
01299 base = fileloc_getBase (g_currentloc);
01300 insertModuleAccess (base, t);
01301 DPRINTF (("Add file access: %s / %s", typeIdSet_unparse (gc.facct),
01302 typeIdSet_unparse (gc.acct)));
01303 }
|
|
|
Definition at line 246 of file context.c. 00247 {
00248 macrocache_addEntry (gc.mc, fileloc_copy (g_currentloc), def);
00249 }
|
|
|
Definition at line 3852 of file context.c. Referenced by main(). 03853 {
03854 return (gc.numerrors > 0);
03855 }
|
|
|
Definition at line 2355 of file context.c. Referenced by ctype_realType(). 02355 {
02356 /* For now, this is bogus! */
02357 return ctype_int;
02358 }
|
|
|
Definition at line 1422 of file context.c. Referenced by exprNode_break(). 01423 {
01424 clauseStack_elements (gc.clauses, el)
01425 {
01426 if (clause_isSwitch (el))
01427 {
01428 return el;
01429 }
01430 else if (clause_isLoop (el))
01431 {
01432 return el;
01433 }
01434 else
01435 {
01436 ;
01437 }
01438 } end_clauseStack_elements;
01439
01440 return NOCLAUSE;
01441 }
|
|
|
Definition at line 2361 of file context.c. Referenced by ctype_realType(). 02362 {
02363 static typeId boolType = typeId_invalid;
02364
02365 if (typeId_isInvalid (boolType))
02366 {
02367 boolType = usymtab_getTypeId (context_getBoolName ());
02368 }
02369
02370 if (!typeId_isInvalid (boolType))
02371 {
02372 return context_hasAccess (boolType);
02373 }
02374 else
02375 {
02376 ;
02377 }
02378
02379 return FALSE;
02380 }
|
|
|
Definition at line 1764 of file context.c. Referenced by sRef_isAliasCheckedGlobal(). 01765 {
01766 if (uentry_isCheckedStrict (glob))
01767 {
01768 return gc.flags[FLG_CHECKSTRICTGLOBALIAS];
01769 }
01770 else if (uentry_isChecked (glob))
01771 {
01772 return gc.flags[FLG_CHECKEDGLOBALIAS];
01773 }
01774 else if (uentry_isCheckMod (glob))
01775 {
01776 return gc.flags[FLG_CHECKMODGLOBALIAS];
01777 }
01778 else
01779 {
01780 llassert (uentry_isUnchecked (glob) || uentry_isCheckedUnknown (glob));
01781
01782 return gc.flags[FLG_UNCHECKEDGLOBALIAS];
01783 }
01784 }
|
|
|
Definition at line 1704 of file context.c. Referenced by exprChecks_checkExport(). 01705 {
01706 if (!gc.anyExports) return FALSE;
01707
01708 if (uentry_isFunction (e)
01709 || (uentry_isVariable (e) && ctype_isFunction (uentry_getType (e))))
01710 {
01711 return context_maybeSet (FLG_EXPORTFCN);
01712 }
01713 else if (uentry_isExpandedMacro (e))
01714 {
01715 return context_maybeSet (FLG_EXPORTMACRO);
01716 }
01717 else if (uentry_isVariable (e))
01718 {
01719 return context_maybeSet (FLG_EXPORTVAR);
01720 }
01721 else if (uentry_isEitherConstant (e))
01722 {
01723 return context_maybeSet (FLG_EXPORTCONST);
01724 }
01725 else if (uentry_isIter (e) || uentry_isEndIter (e))
01726 {
01727 return context_maybeSet (FLG_EXPORTITER);
01728 }
01729 else if (uentry_isDatatype (e))
01730 {
01731 return context_maybeSet (FLG_EXPORTTYPE);
01732 }
01733 else
01734 {
01735 BADEXIT;
01736 }
01737 }
|
|
|
Definition at line 1799 of file context.c. 01800 {
01801 uentry ue = sRef_getUentry (el);
01802
01803 /* no: llassert (sRef_isGlobal (el)); also check local statics */
01804
01805 if (uentry_isCheckedModify (ue)
01806 || (!uentry_isUnchecked (ue) && (gc.flags[FLG_ALLGLOBALS])))
01807 {
01808 if (context_hasMods ())
01809 {
01810 return (gc.flags[FLG_MODGLOBS]);
01811 }
01812 else
01813 {
01814 if (uentry_isCheckedStrict (ue))
01815 {
01816 return (gc.flags[FLG_MODGLOBSUNSPEC]);
01817 }
01818 else
01819 {
01820 return (gc.flags[FLG_MODSTRICTGLOBSUNSPEC]);
01821 }
01822 }
01823 }
01824 else
01825 {
01826 if (context_hasMods ())
01827 {
01828 return (gc.flags[FLG_MODGLOBSUNCHECKED]);
01829 }
01830 else
01831 {
01832 return FALSE;
01833 }
01834 }
01835 }
|
|
|
Definition at line 1740 of file context.c. 01741 {
01742
01743 if (uentry_isCheckedStrict (glob))
01744 {
01745 return context_checkStrictGlobals ();
01746 }
01747 else if (uentry_isChecked (glob))
01748 {
01749 return context_checkCheckedGlobals ();
01750 }
01751 else if (uentry_isCheckedUnknown (glob) || uentry_isCheckMod (glob))
01752 {
01753 return context_checkUnknownGlobals ();
01754 }
01755 else
01756 {
01757 llassert (uentry_isUnchecked (glob));
01758
01759 return context_checkUncheckedGlobals ();
01760 }
01761 }
|
|
|
Definition at line 1786 of file context.c. 01787 {
01788 if (context_hasGlobs ())
01789 {
01790 return (gc.flags[FLG_INTERNALGLOBS]);
01791 }
01792 else
01793 {
01794 return (gc.flags[FLG_INTERNALGLOBSNOGLOBS]);
01795 }
01796 }
|
|
|
Definition at line 403 of file context.c. Referenced by main(). 00404 {
00405 if (context_getFlag (FLG_SUPCOUNTS))
00406 {
00407 flagMarkerList_checkSuppressCounts (gc.markers);
00408 }
00409 }
|
|
|
Definition at line 2430 of file context.c. 02431 {
02432 gc.aliasAnnote = sRef_undefined;
02433 }
|
|
|
Definition at line 203 of file context.c. Referenced by main(). 00204 {
00205 llassert (gc.incommandline);
00206 gc.incommandline = FALSE;
00207 }
|
|
|
Definition at line 4108 of file context.c. 04109 {
04110 gc.justpopped = FALSE;
04111 }
|
|
|
Definition at line 2396 of file context.c. Referenced by exprNode_for(). 02397 {
02398 if (cstring_isDefined (gc.msgAnnote))
02399 {
02400 cstring_free (gc.msgAnnote);
02401 gc.msgAnnote = cstring_undefined;
02402 }
02403 }
|
|
|
Definition at line 186 of file context.c. Referenced by filelocStack_printIncludes(), genppllerrorhint(), and main(). 00187 {
00188 llassert (gc.preprocessing);
00189 gc.preprocessing = FALSE;
00190 }
|
|
|
Definition at line 1899 of file context.c. 01900 {
01901 if (gc.kind == CX_FUNCTION || gc.kind == CX_MACROFCN || gc.kind == CX_UNKNOWNMACRO)
01902 {
01903 return (typeIdSet_member (gc.acct, t));
01904 }
01905 else
01906 {
01907 return (typeIdSet_member (gc.facct, t));
01908 }
01909 }
|
|
|
Definition at line 2824 of file context.c. 02825 {
02826 if (gc.kind == CX_FUNCTION || gc.kind == CX_MACROFCN)
02827 {
02828 return (uentry_getType (gc.cont.fcn));
02829 }
02830 else if (gc.kind == CX_INNER)
02831 {
02832 llcontbuglit ("context_currentFunctionType: inner context");
02833 do { context_exitInnerPlain (); } while (gc.kind == CX_INNER);
02834 return (context_currentFunctionType ());
02835 }
02836 else
02837 {
02838 llcontbuglit ("context_currentFunctionType: not in function");
02839 return (ctype_undefined);
02840 }
02841 }
|
|
|
Definition at line 2554 of file context.c. 02555 {
02556 int index = flagcode_valueIndex (flag);
02557
02558 llassert (index >= 0 && index <= NUMVALUEFLAGS);
02559 gc.counters[index]--;
02560 }
|
|
|
Definition at line 3755 of file context.c. Referenced by llexit(). 03757 {
03758 setCodePoint ();
03759 ctype_destroyMod ();
03760 setCodePoint ();
03761 usymtab_free ();
03762 setCodePoint ();
03763 fileTable_free (gc.ftab);
03764 filelocStack_free (gc.locstack);
03765 setCodePoint ();
03766 gc.ftab = fileTable_undefined;
03767
03768 macrocache_free (gc.mc);
03769 sfree (gc.moduleaccess);
03770 setCodePoint ();
03771
03772 fileloc_free (gc.saveloc); gc.saveloc = fileloc_undefined;
03773 fileloc_free (gc.pushloc); gc.pushloc = fileloc_undefined;
03774
03775 setCodePoint ();
03776 sRefSetList_free (gc.modrecs);
03777 setCodePoint ();
03778 flagMarkerList_free (gc.markers);
03779 setCodePoint ();
03780 messageLog_free (gc.msgLog);
03781 setCodePoint ();
03782 clauseStack_free (gc.clauses);
03783 setCodePoint ();
03784
03785 cstring_free (gc.msgAnnote);
03786 globSet_free (gc.globs_used);
03787 }
|
|
|
Definition at line 3969 of file context.c. Referenced by main(). 03970 {
03971 return cstring_isNonEmpty (context_getString (FLG_DUMP));
03972 }
|
|
|
Definition at line 3974 of file context.c. Referenced by BUFLEN(), and main(). 03975 {
03976 return cstring_isNonEmpty (context_getString (FLG_MERGE));
03977 }
|
|
|
Definition at line 516 of file context.c. Referenced by dumpState(). 00517 {
00518 int i = 0;
00519
00520 for (i = 0; i < gc.nmods; i++)
00521 {
00522 cstring td = typeIdSet_dump (gc.moduleaccess[i].daccess);
00523
00524 fprintf (fout, "%s#%s@\n",
00525 cstring_toCharsSafe (gc.moduleaccess[i].file),
00526 cstring_toCharsSafe (td));
00527
00528 cstring_free (td);
00529 }
00530 }
|
|
|
Definition at line 1349 of file context.c. 01350 {
01351
01352 usymtab_trueBranch (guardSet_copy (exprNode_getGuards (e)));
01353 pushClause (ANDCLAUSE);
01354 }
|
|
|
Definition at line 1562 of file context.c. 01563 {
01564 bool branch = FALSE;
01565
01566 DPRINTF (("Enter case clause!"));
01567
01568 branch = usymtab_newCase (exprNode_undefined, e);
01569
01570 if (branch)
01571 {
01572 context_enterCondClauseAux (CASECLAUSE);
01573 }
01574 }
|
|
|
Definition at line 1591 of file context.c. 01592 {
01593 gc.kind = CX_MACROCONST;
01594 gc.cont.fcn = e;
01595 gc.showfunction = context_getFlag (FLG_SHOWFUNC);
01596
01597 gc.acct = typeIdSet_subtract (typeIdSet_union (gc.facct, uentry_accessType (e)),
01598 gc.nacct);
01599
01600
01601 usymtab_enterScope ();
01602 sRef_enterFunctionScope ();
01603
01604 gc.globs = globSet_undefined;
01605 globSet_clear (gc.globs_used);
01606 gc.mods = sRefSet_undefined;
01607 }
|
|
|
Definition at line 1523 of file context.c. 01524 {
01525 pushClause (DOWHILECLAUSE);
01526 }
|
|
|
Definition at line 1584 of file context.c. 01585 {
01586
01587 context_enterFalseClauseAux (e, FALSECLAUSE);
01588 }
|
|
|
Definition at line 3032 of file context.c. Referenced by main(). 03033 {
03034 context_enterFileAux ();
03035 usymtab_enterFile ();
03036 }
|
|
|
Definition at line 1533 of file context.c. 01534 {
01535 context_enterTrueAux (e, FORCLAUSE);
01536 }
|
|
|
Definition at line 1637 of file context.c. Referenced by context_enterMacro(), context_enterUnknownMacro(), and declareStaticFunction(). 01638 {
01639 gc.kind = CX_FUNCTION;
01640 gc.cont.fcn = e;
01641
01642 if (uentry_hasAccessType (e))
01643 {
01644 gc.acct = typeIdSet_subtract (typeIdSet_union (gc.facct, uentry_accessType (e)),
01645 gc.nacct);
01646 }
01647 else
01648 {
01649 gc.acct = gc.facct;
01650 }
01651
01652 DPRINTF (("Enter function: %s / %s", uentry_unparse (e),
01653 typeIdSet_unparse (gc.acct)));
01654
01655 gc.showfunction = context_getFlag (FLG_SHOWFUNC);
01656
01657 gc.globs = uentry_getGlobs (e);
01658 globSet_clear (gc.globs_used);
01659 gc.mods = uentry_getMods (e);
01660
01661 usymtab_enterFunctionScope (e);
01662 sRef_enterFunctionScope ();
01663 }
|
|
|
Definition at line 1318 of file context.c. 01319 {
01320 llassert (gc.kind == CX_GLOBAL);
01321 gc.kind = CX_FCNDECL;
01322 }
|
|
|
Definition at line 4000 of file context.c. Referenced by processImport(). 04001 {
04002 gc.inimport = TRUE;
04003 }
|
|
|
Definition at line 2844 of file context.c. 02845 {
02846 if (gc.kind == CX_GLOBAL)
02847 {
02848 gc.kind = CX_INNER;
02849 gc.cont.cdepth = 1;
02850 }
02851 else if (gc.kind == CX_INNER)
02852 {
02853 gc.cont.cdepth++;
02854 }
02855 else
02856 {
02857 ;
02858 }
02859
02860
02861 usymtab_enterScope ();
02862 pushClause (NOCLAUSE);
02863 }
|
|
|
Definition at line 1518 of file context.c. 01519 {
01520 context_enterTrueAux (exprNode_undefined, ITERCLAUSE);
01521 }
|
|
|
Definition at line 3741 of file context.c. 03742 {
03743 context_enterMacro (le);
03744 gc.acct = typeIdSet_subtract (gc.facct, gc.nacct);
03745 gc.kind = CX_ITERDEF;
03746 }
|
|
|
Definition at line 3748 of file context.c. 03749 {
03750 context_enterMacro (le);
03751 gc.kind = CX_ITEREND;
03752 }
|
|
|
Definition at line 432 of file context.c. 00433 {
00434 gc.kind = CX_LCL;
00435 gc.facct = typeIdSet_emptySet ();
00436 }
|
|
|
Definition at line 1335 of file context.c. Referenced by context_enterIterDef(), and context_enterIterEnd(). 01336 {
01337 context_enterFunction (e);
01338 gc.kind = CX_MACROFCN;
01339 }
|
|
|
Definition at line 3039 of file context.c. 03040 {
03041 context_enterFileAux ();
03042 }
|
|
|
Definition at line 1356 of file context.c. 01357 {
01358 usymtab_trueBranch (guardSet_invert (exprNode_getGuards (e)));
01359 pushClause (ORCLAUSE);
01360 }
|
|
|
Definition at line 2903 of file context.c. 02904 {
02905 if (gc.kind == CX_GLOBAL)
02906 {
02907 gc.kind = CX_INNER;
02908 gc.cont.cdepth = 1;
02909 }
02910 else if (gc.kind == CX_INNER)
02911 {
02912 gc.cont.cdepth++;
02913 }
02914 else
02915 {
02916 ;
02917 }
02918
02919 usymtab_enterScope ();
02920 }
|
|
|
Definition at line 390 of file context.c. 00391 {
00392 fileloc nextline = fileloc_copy (g_currentloc);
00393
00394 flagMarkerList_add (gc.markers,
00395 flagMarker_createIgnoreCount (count, g_currentloc));
00396
00397 fileloc_nextLine (nextline);
00398 flagMarkerList_add (gc.markers,
00399 flagMarker_createIgnoreOff (nextline));
00400 fileloc_free (nextline);
00401 }
|
|
|
Definition at line 368 of file context.c. 00369 {
00370 if (gc.insuppressregion)
00371 {
00372 gc.insuppressregion = FALSE; /* get this msg! */
00373 llmsg (message
00374 ("%q: New ignore errors region entered while in ignore errors region",
00375 fileloc_unparse (g_currentloc)));
00376 }
00377
00378 gc.insuppressregion = TRUE;
00379 flagMarkerList_add (gc.markers, flagMarker_createIgnoreOn (g_currentloc));
00380 }
|
|
|
Definition at line 1543 of file context.c. 01544 {
01545
01546 usymtab_switchBranch (e);
01547 context_enterCondClauseAux (SWITCHCLAUSE);
01548 }
|
|
|
Definition at line 1538 of file context.c. 01539 {
01540 context_enterTrueAux (e, TRUECLAUSE);
01541 }
|
|
|
Definition at line 1342 of file context.c. 01343 {
01344 llassert (uentry_isFunction (e));
01345 context_enterFunction (e);
01346 gc.kind = CX_UNKNOWNMACRO;
01347 }
|
|
|
Definition at line 1528 of file context.c. 01529 {
01530 context_enterTrueAux (e, WHILECLAUSE);
01531 }
|
|
|
Definition at line 1956 of file context.c. Referenced by exprNode_checkIterBody(), and exprNode_checkIterEnd(). 01957 {
01958
01959 while (!clauseStack_isEmpty (gc.clauses))
01960 {
01961 clause el = clauseStack_top (gc.clauses);
01962
01963 gc.inclause = el;
01964
01965 if (clause_isNone (el))
01966 {
01967 usymtab_quietExitScope (g_currentloc);
01968 clauseStack_pop (gc.clauses);
01969 }
01970 else
01971 {
01972 context_exitClausePlain ();
01973 }
01974 }
01975
01976 clauseStack_clear (gc.clauses);
01977
01978
01979 gc.inclause = NOCLAUSE;
01980 }
|
|
|
Definition at line 1483 of file context.c. 01484 {
01485 context_setJustPopped ();
01486
01487 llassert (gc.inclause == ANDCLAUSE);
01488
01489 usymtab_popAndBranch (pred, tbranch);
01490 clauseStack_pop (gc.clauses);
01491 gc.inclause = topClause (gc.clauses);
01492 }
|
|
|
Definition at line 2170 of file context.c. 02171 {
02172
02173 context_setJustPopped ();
02174
02175 if (gc.inclause == FALSECLAUSE)
02176 {
02177 usymtab_popBranches (pred, tbranch, fbranch, FALSE, FALSECLAUSE);
02178
02179 llassert (clauseStack_top (gc.clauses) == FALSECLAUSE);
02180
02181 clauseStack_pop (gc.clauses);
02182 gc.inclause = topClause (gc.clauses);
02183 }
02184 else
02185 {
02186 context_exitTrueClause (pred, tbranch);
02187 }
02188 }
|
|
|
Definition at line 2107 of file context.c. Referenced by exprNode_doWhile(). 02108 {
02109 guardSet invGuards = guardSet_invert (exprNode_getGuards (pred));
02110
02111 if (gc.inclause == CASECLAUSE) {
02112 /* handle Duff's device */
02113 clauseStack_pop (gc.clauses);
02114 gc.inclause = topClause (gc.clauses);
02115 }
02116
02117 llassert (gc.inclause == DOWHILECLAUSE);
02118
02119 context_setJustPopped ();
02120
02121
02122 usymtab_addGuards (invGuards);
02123 guardSet_free (invGuards);
02124
02125 clauseStack_pop (gc.clauses);
02126 gc.inclause = topClause (gc.clauses);
02127 }
|
|
|
Definition at line 3124 of file context.c. Referenced by main(). 03125 {
03126 if (gc.kind != CX_GLOBAL)
03127 {
03128 llfatalerrorLoc
03129 (cstring_makeLiteral ("File ended outside global scope"));
03130 }
03131
03132 if (gc.insuppressregion)
03133 {
03134 /* gack...don't reverse the order of these lines! ;-> */
03135 gc.insuppressregion = FALSE;
03136 llerrorlit (FLG_SYNTAX,
03137 "File ended in ignore errors region, "
03138 "possible missing /*@end*/");
03139 }
03140
03141 /* fix up parse errors */
03142
03143 while (!usymtab_inFileScope ())
03144 {
03145 usymtab_quietExitScope (g_currentloc);
03146 }
03147
03148 /*
03149 ** Clear the file-specific modifies information.
03150 */
03151
03152 sRefSetList_elements (gc.modrecs, mods)
03153 {
03154 sRefSet_clearStatics (mods);
03155 } end_sRefSetList_elements ;
03156
03157 sRefSetList_clear (gc.modrecs);
03158
03159 context_processMacros ();
03160 cleanupMessages ();
03161
03162 usymtab_exitFile ();
03163
03164 gc.inDerivedFile = FALSE;
03165 filelocStack_clear (gc.locstack);
03166
03167 gc.nacct = typeIdSet_emptySet (); /* empty noaccess */
03168
03169 gc.cont.glob = TRUE;
03170
03171 if (gc.savedFlags)
03172 {
03173 context_restoreFlagSettings ();
03174 gc.savedFlags = FALSE;
03175 }
03176 }
|
|
|
Definition at line 2129 of file context.c. 02130 {
02131 guardSet invGuards = guardSet_invert (exprNode_getForGuards (forPred));
02132
02133 llassert (gc.inclause == FORCLAUSE);
02134 context_setJustPopped ();
02135
02136 /*
02137 ** predicate must be false after while loop (unless there are breaks)
02138 */
02139
02140 if (context_getFlag (FLG_LOOPEXEC))
02141 {
02142 usymtab_popTrueExecBranch (forPred, body, FORCLAUSE);
02143 }
02144 else
02145 {
02146 usymtab_popTrueBranch (forPred, body, FORCLAUSE);
02147 }
02148
02149 usymtab_addGuards (invGuards);
02150 guardSet_free (invGuards);
02151 clauseStack_pop (gc.clauses);
02152 gc.inclause = topClause (gc.clauses);
02153 }
|
|
|
Definition at line 2197 of file context.c. Referenced by context_exitMacroCache(), exprChecks_checkEmptyMacroBody(), exprNode_checkIterBody(), exprNode_checkIterEnd(), and exprNode_checkMacroBody(). 02198 {
02199 if (!context_inFunction () && !context_inMacroConstant ()
02200 && !context_inMacroUnknown ()
02201 && !context_inIterDef () && !context_inIterEnd ())
02202 {
02203 /*
02204 ** not a bug because of parse errors
02205 */
02206 }
02207 else
02208 {
02209 if (context_inMacro () && usymtab_inFunctionScope ())
02210 {
02211 usymtab_exitScope (exprNode_undefined);
02212 }
02213
02214 if (uentry_hasGlobs (gc.cont.fcn))
02215 {
02216 exprChecks_checkUsedGlobs (gc.globs, gc.globs_used);
02217 }
02218
02219
02220 if (uentry_hasMods (gc.cont.fcn))
02221 {
02222 if (context_getFlag (FLG_MUSTMOD))
02223 {
02224 exprNode_checkAllMods (gc.mods, gc.cont.fcn);
02225 }
02226 }
02227
02228 /*
02229 ** clear file static modifies
02230 */
02231
02232 /* do this first to get unused error messages */
02233
02234 usymtab_exitScope (exprNode_undefined);
02235 sRef_exitFunctionScope ();
02236
02237 gc.showfunction = FALSE;
02238 gc.kind = CX_GLOBAL;
02239 gc.cont.glob = TRUE;
02240 gc.acct = gc.facct;
02241 gc.globs = globSet_new ();
02242 globSet_clear (gc.globs_used);
02243 gc.mods = sRefSet_new ();
02244 }
02245
02246 llassert (clauseStack_isEmpty (gc.clauses));
02247 llassert (gc.inclause == NOCLAUSE);
02248 }
|
|
|
Definition at line 1324 of file context.c. 01325 {
01326 gc.kind = CX_GLOBAL;
01327 }
|
|
|
Definition at line 2872 of file context.c. Referenced by context_exitInnerPlain(). 02873 {
02874
02875 llassertprint (gc.inclause == NOCLAUSE || gc.inclause == CASECLAUSE,
02876 ("inclause = %s", clause_nameTaken (gc.inclause)));
02877
02878 clauseStack_removeFirst (gc.clauses, NOCLAUSE);
02879 gc.inclause = topClause (gc.clauses);
02880
02881 if (gc.kind == CX_INNER)
02882 {
02883 if (--gc.cont.cdepth == 0)
02884 {
02885 gc.kind = CX_GLOBAL;
02886 gc.cont.glob = TRUE;
02887 }
02888 }
02889 else
02890 {
02891 if (gc.kind == CX_GLOBAL)
02892 {
02893 llcontbuglit ("Attempt to exit global context");
02894 return;
02895 }
02896 }
02897
02898 usymtab_exitScope (exp);
02899 }
|
|
|
Definition at line 2866 of file context.c. Referenced by context_currentFunctionType(), and context_quietExitFunction(). 02867 {
02868 context_exitInner (exprNode_undefined);
02869 }
|
|
|
Definition at line 2946 of file context.c. 02947 {
02948
02949 if (gc.kind == CX_INNER)
02950 {
02951 if (--gc.cont.cdepth == 0)
02952 {
02953 gc.cont.cdepth++;
02954 }
02955 }
02956 else if (gc.kind == CX_GLOBAL)
02957 {
02958 llcontbuglit ("Attempt to exit global context");
02959 return;
02960 }
02961 else
02962 {
02963 if (usymtab_inDeepScope ())
02964 {
02965 usymtab_exitScope (exprNode_undefined);
02966 }
02967 }
02968 }
|
|
|
Definition at line 2027 of file context.c. Referenced by exprNode_iter(). 02028 {
02029 llassert (gc.inclause == ITERCLAUSE);
02030
02031 context_setJustPopped ();
02032
02033 if (context_getFlag (FLG_LOOPEXEC))
02034 {
02035 usymtab_popTrueExecBranch (exprNode_undefined, body, ITERCLAUSE);
02036 }
02037 else
02038 {
02039 usymtab_popTrueBranch (exprNode_undefined, body, ITERCLAUSE);
02040 }
02041
02042 clauseStack_pop (gc.clauses);
02043 gc.inclause = topClause (gc.clauses);
02044 }
|
|
|
Definition at line 496 of file context.c. 00497 {
00498 if (gc.kind != CX_LCLLIB)
00499 {
00500 char *lclname =
00501 removeExtension (cstring_toCharsSafe
00502 (fileName (currentFile ())), ".lcl");
00503
00504 addModuleAccess (cstring_fromCharsO (removePath (lclname)), gc.facct);
00505
00506 mstring_free (lclname);
00507 }
00508
00509 gc.kind = CX_LCL;
00510 gc.kind = CX_GLOBAL;
00511 gc.facct = typeIdSet_emptySet ();
00512 }
|
|
|
Definition at line 3179 of file context.c. 03180 {
03181 if (gc.kind != CX_GLOBAL)
03182 {
03183 if (context_inMacro ()) /* this is okay, file could end without newline in macro */
03184 {
03185 context_exitFunction ();
03186 }
03187 else
03188 {
03189 llcontbug (message ("context_exitMacroCache: outside global scope: %q",
03190 context_unparse ()));
03191 gc.kind = CX_GLOBAL;
03192 }
03193 }
03194
03195 /*
03196 ** no longer valid here
03197 ** if (gc.insuppressregion)
03198 ** {
03199 ** gc.insuppressregion = FALSE;
03200 ** llerror ("File ended in ignore errors region, possible missing @");
03201 ** }
03202 */
03203
03204 gc.cont.glob = TRUE;
03205 }
|
|
|
Definition at line 1494 of file context.c. 01495 {
01496 context_setJustPopped ();
01497
01498 llassert (gc.inclause == ORCLAUSE);
01499
01500 usymtab_popOrBranch (pred, tbranch);
01501 clauseStack_pop (gc.clauses);
01502 gc.inclause = topClause (gc.clauses);
01503 }
|
|
|
Definition at line 2923 of file context.c. 02924 {
02925 if (gc.kind == CX_INNER)
02926 {
02927 if (--gc.cont.cdepth == 0)
02928 {
02929 gc.kind = CX_GLOBAL;
02930 gc.cont.glob = TRUE;
02931 }
02932 }
02933 else
02934 {
02935 if (gc.kind == CX_GLOBAL)
02936 {
02937 llcontbuglit ("Attempt to exit global context");
02938 return;
02939 }
02940 }
02941
02942 usymtab_exitScope (exprNode_undefined);
02943 }
|
|
|
Definition at line 418 of file context.c. 00419 {
00420 if (!gc.insuppressregion)
00421 {
00422 llerrorlit (FLG_SYNTAX,
00423 "End ignore errors in region while not ignoring errors");
00424 }
00425
00426 gc.insuppressregion = FALSE;
00427 flagMarkerList_add (gc.markers, flagMarker_createIgnoreOff (g_currentloc));
00428 }
|
|
|
Definition at line 1550 of file context.c. Referenced by exprNode_switch(). 01551 {
01552 usymtab_exitSwitch (e, allpaths);
01553
01554 while (clause_isCase (clauseStack_top (gc.clauses)))
01555 {
01556 clauseStack_pop (gc.clauses);
01557 }
01558
01559 context_exitClauseSimp ();
01560 }
|
|
|
Definition at line 2009 of file context.c. Referenced by context_exitClause(). 02010 {
02011 if (gc.inclause != TRUECLAUSE)
02012 {
02013 llparseerror (cstring_makeLiteral
02014 ("Likely parse error. Conditional clauses are inconsistent."));
02015 return;
02016 }
02017
02018
02019 context_setJustPopped ();
02020
02021 usymtab_popTrueBranch (pred, tbranch, TRUECLAUSE);
02022 clauseStack_pop (gc.clauses);
02023 gc.inclause = topClause (gc.clauses);
02024
02025 }
|
|
|
Definition at line 2070 of file context.c. 02071 {
02072 guardSet invGuards = guardSet_invert (exprNode_getGuards (pred));
02073
02074 context_popCase ();
02075
02076 if (gc.inclause != WHILECLAUSE) {
02077 DPRINTF (("Clause: %s / %s", clause_unparse (gc.inclause),
02078 clauseStack_unparse (gc.clauses)));
02079 }
02080
02081 llassert (gc.inclause == WHILECLAUSE);
02082
02083 context_setJustPopped ();
02084
02085
02086 /*
02087 ** predicate must be false after while loop (unless there are breaks)
02088 */
02089
02090 if (context_getFlag (FLG_LOOPEXEC))
02091 {
02092 usymtab_popTrueExecBranch (pred, body, WHILECLAUSE);
02093 }
02094 else
02095 {
02096 usymtab_popTrueBranch (pred, body, WHILECLAUSE);
02097 }
02098
02099
02100 usymtab_addGuards (invGuards);
02101 guardSet_free (invGuards);
02102
02103 clauseStack_pop (gc.clauses);
02104 gc.inclause = topClause (gc.clauses);
02105 }
|
|
|
Definition at line 627 of file context.c. 00628 {
00629 return gc.facct;
00630 }
|
|
|
Definition at line 3326 of file context.c. 03327 {
03328 if (!gc.savedFlags)
03329 {
03330 context_saveFlagSettings ();
03331 }
03332
03333 if (ynm_isOff (set))
03334 {
03335 context_setFlagAux (f, FALSE, TRUE, FALSE);
03336 }
03337 else if (ynm_isOn (set))
03338 {
03339 context_setFlagAux (f, TRUE, TRUE, FALSE);
03340 gc.setLocally[f] = TRUE;
03341 }
03342 else
03343 {
03344 context_restoreFlag (f);
03345 }
03346 }
|
|
|
Definition at line 3934 of file context.c. 03935 {
03936 return gc.ftab;
03937 }
|
|
|
Definition at line 2436 of file context.c. 02437 {
02438 sRef ret = gc.aliasAnnote;
02439 sRef als = gc.aliasAnnoteAls;
02440
02441 llassert (sRef_isValid (ret) && sRef_isValid (als));
02442
02443 gc.aliasAnnote = sRef_undefined;
02444 return (message ("%q aliases %q", sRef_unparse (als), sRef_unparse (ret)));
02445 }
|
|
|
Definition at line 4078 of file context.c. Referenced by context_printBoolName(), processNamedDecl(), and usymtab_isBoolType(). 04079 {
04080 return (context_getString (FLG_BOOLTYPE));
04081 }
|
|
|
Definition at line 2468 of file context.c. 02469 {
02470 return ((char) context_getValue (FLG_COMMENTCHAR));
02471 }
|
|
|
Definition at line 2535 of file context.c. 02536 {
02537 int index = flagcode_valueIndex (flag);
02538
02539 llassert (index >= 0 && index <= NUMVALUEFLAGS);
02540 return (gc.counters[index]);
02541 }
|
|
|
Definition at line 3979 of file context.c. Referenced by main(). 03980 {
03981 return context_getString (FLG_DUMP);
03982 }
|
|
|
Definition at line 3877 of file context.c. Referenced by main(). 03878 {
03879 return (context_getValue (FLG_EXPECT));
03880 }
|
|
|
Definition at line 4083 of file context.c. 04084 {
04085 return (context_getString (FLG_BOOLFALSE));
04086 }
|
|
|
|
Definition at line 2308 of file context.c. Referenced by usymtab_checkFinalScope(). 02309 {
02310 llassert (gc.kind == CX_FUNCTION || gc.kind == CX_MACROFCN
02311 || gc.kind == CX_UNKNOWNMACRO || gc.kind == CX_ITERDEF);
02312
02313 return (gc.globs);
02314 }
|
|
|
Definition at line 1609 of file context.c. Referenced by checkReturnTransfer(), exprChecks_checkEmptyMacroBody(), exprNode_checkAllMods(), exprNode_checkMacroBody(), and usymtab_checkFinalScope(). 01610 {
01611 if (!(context_inFunctionLike () || (gc.kind == CX_MACROCONST)))
01612 {
01613 llfatalbug (message ("context_getHeader: bad call: %q",
01614 context_unparse ()));
01615 }
01616
01617 return (gc.cont.fcn);
01618 }
|
|
|
Definition at line 3883 of file context.c. Referenced by main(). 03884 {
03885 return (context_getValue (FLG_LCLEXPECT));
03886 }
|
|
|
Definition at line 4098 of file context.c. 04099 {
04100 return (context_getString (FLG_LCLIMPORTDIR));
04101 }
|
|
|
Definition at line 4093 of file context.c. Referenced by processImport(). 04094 {
04095 return (context_getString (FLG_LARCHPATH));
04096 }
|
|
|
Definition at line 545 of file context.c. Referenced by dumpState(). 00546 {
00547 return gc.library;
00548 }
|
|
|
Definition at line 3889 of file context.c. Referenced by cleanupMessages(), and context_unlimitedMessages(). 03890 {
03891 return (context_getValue (FLG_LIMIT));
03892 }
|
|
|
Definition at line 4028 of file context.c. Referenced by main(). 04029 {
04030 return (gc.linesprocessed);
04031 }
|
|
|
Definition at line 3984 of file context.c. Referenced by main(). 03985 {
03986 return context_getString (FLG_MERGE);
03987 }
|
|
|
Definition at line 2406 of file context.c. 02407 {
02408 cstring st = gc.msgAnnote;
02409
02410 gc.msgAnnote = cstring_undefined;
02411 return st;
02412 }
|
|
|
Definition at line 2279 of file context.c. Referenced by exprNode_checkAllMods(), usymtab_checkFinalScope(), and usymtab_exitScope(). 02280 {
02281 if (context_inFunctionLike ())
02282 {
02283 return (uentry_getParams (gc.cont.fcn));
02284 }
02285 else
02286 {
02287 llcontbug (message ("context_getParams: not in function: %q", context_unparse ()));
02288 return uentryList_undefined;
02289 }
02290 }
|
|
|
Definition at line 1912 of file context.c. Referenced by exprNode_checkMacroBody(). 01913 {
01914 ctype f = ctype_undefined;
01915
01916 if (gc.kind == CX_FUNCTION || gc.kind == CX_MACROFCN)
01917 {
01918 f = uentry_getType (gc.cont.fcn);
01919 }
01920 else if (gc.kind == CX_UNKNOWNMACRO)
01921 {
01922 return ctype_unknown;
01923 }
01924 else
01925 {
01926 llcontbuglit ("context_getRetType: not in a function context");
01927 return ctype_unknown;
01928 }
01929
01930 if (!ctype_isFunction (f))
01931 {
01932 if (ctype_isKnown (f))
01933 {
01934 llbuglit ("context_getRetType: not a function");
01935 }
01936
01937 return ctype_unknown;
01938 }
01939 return (ctype_returnValue (f));
01940 }
|
|
|
Definition at line 3218 of file context.c. Referenced by exprNode_createId(), exprNode_fromUIO(), exprNode_iterId(), and exprNode_iterNewId(). 03219 {
03220 fileloc fl = gc.saveloc;
03221
03222 gc.saveloc = fileloc_undefined;
03223 return fl;
03224 }
|
|
|
Definition at line 4033 of file context.c. Referenced by main(). 04034 {
04035 return (gc.speclinesprocessed);
04036 }
|
|
|
Definition at line 2662 of file context.c. Referenced by checkParamNames(), checkPrefix(), context_addBoolAccess(), context_getBoolName(), context_getDump(), context_getFalseName(), context_getLCLImportDir(), context_getLarchPath(), context_getMerge(), context_getTrueName(), and context_tmpdir(). 02663 {
02664 return (context_exposeString (flag));
02665 }
|
|
|
Definition at line 4088 of file context.c. 04089 {
04090 return (context_getString (FLG_BOOLTRUE));
04091 }
|
|
|
Definition at line 2293 of file context.c. Referenced by usymtab_checkFinalScope(), and usymtab_exitScope(). 02294 {
02295 llassert (gc.kind == CX_FUNCTION || gc.kind == CX_MACROFCN
02296 || gc.kind == CX_UNKNOWNMACRO || gc.kind == CX_ITERDEF);
02297
02298 return (gc.globs_used);
02299 }
|
|
|
Definition at line 2526 of file context.c. Referenced by context_getCommentMarkerChar(), context_getExpect(), context_getLCLExpect(), context_getLimit(), context_setFilename(), declareStruct(), declareUnion(), declareUnnamedStruct(), declareUnnamedUnion(), and exprNode_stringLiteral(). 02527 {
02528 int index = flagcode_valueIndex (flag);
02529
02530 llassert (index >= 0 && index <= NUMVALUEFLAGS);
02531 return (gc.values[index]);
02532 }
|
|
|
Definition at line 1860 of file context.c. 01861 {
01862 llassert (sRef_isGlobal (s) || sRef_isKindSpecial (s));
01863 return (globSet_member (gc.globs, s));
01864 }
|
|
|
Definition at line 1867 of file context.c. Referenced by context_canAccessBool(), ctype_isBool(), exprNode_cast(), and uentry_getRealType(). 01868 {
01869 if (context_inFunctionLike ())
01870 {
01871 return (typeIdSet_member (gc.acct, t));
01872 }
01873 else
01874 {
01875 return (context_hasFileAccess (t));
01876 }
01877 }
|
|
|
Definition at line 2424 of file context.c. 02425 {
02426 return (sRef_isValid (gc.aliasAnnote));
02427 }
|
|
|
Definition at line 3857 of file context.c. Referenced by llgloberror(). 03858 {
03859 gc.numerrors++;
03860 }
|
|
|
Definition at line 1880 of file context.c. Referenced by context_hasAccess(), and uentry_checkParams(). 01881 {
01882 return (typeIdSet_member (gc.facct, t));
01883 }
|
|
|
Definition at line 2390 of file context.c. 02391 {
02392 return (cstring_isDefined (gc.msgAnnote));
02393 }
|
|
|
Definition at line 1943 of file context.c. Referenced by context_checkGlobMod(). 01944 {
01945 if (context_inFunctionLike ())
01946 {
01947 return (uentry_hasMods (gc.cont.fcn));
01948 }
01949 else
01950 {
01951 return FALSE;
01952 }
01953 }
|
|
|
Definition at line 3919 of file context.c. Referenced by loadStandardState(). 03920 {
03921 gc.flags[FLG_SHOWSCAN] = FALSE;
03922 }
|
|
|
Definition at line 1465 of file context.c. Referenced by uentry_setUsed(). 01466 {
01467 clauseStack_elements (gc.clauses, el)
01468 {
01469 /*
01470 ** Should also include TRUECLAUSE and FALSECLAUSE, but need
01471 ** to distinguish if from ? for this
01472 */
01473
01474 if (clause_isBreakable (el) && (el != DOWHILECLAUSE))
01475 {
01476 return TRUE;
01477 }
01478 } end_clauseStack_elements;
01479
01480 return FALSE;
01481 }
|
|
|
Definition at line 1362 of file context.c. Referenced by exprNode_break(), and exprNode_continue(). 01363 {
01364 bool inLoop = FALSE;
01365
01366 clauseStack_elements (gc.clauses, el)
01367 {
01368 if (clause_isLoop (el))
01369 {
01370 if (inLoop)
01371 {
01372 return TRUE;
01373 }
01374
01375 inLoop = TRUE;
01376 }
01377 } end_clauseStack_elements;
01378
01379 return FALSE;
01380 }
|
|
|
Definition at line 1402 of file context.c. Referenced by exprNode_break(). 01403 {
01404 bool inLoop = FALSE;
01405
01406 clauseStack_elements (gc.clauses, el)
01407 {
01408 if (clause_isBreakable (el))
01409 {
01410 if (inLoop)
01411 {
01412 return TRUE;
01413 }
01414
01415 inLoop = TRUE;
01416 }
01417 } end_clauseStack_elements;
01418
01419 return FALSE;
01420 }
|
|
|
Definition at line 1382 of file context.c. Referenced by exprNode_break(). 01383 {
01384 bool inLoop = FALSE;
01385
01386 clauseStack_elements (gc.clauses, el)
01387 {
01388 if (clause_isSwitch (el))
01389 {
01390 if (inLoop)
01391 {
01392 return TRUE;
01393 }
01394
01395 inLoop = TRUE;
01396 }
01397 } end_clauseStack_elements;
01398
01399 return FALSE;
01400 }
|
|
|
Definition at line 3045 of file context.c. Referenced by YY_RULE_SETUP(), context_exitFunction(), context_quietExitFunction(), and sRef_isDirectParam(). 03046 {
03047 kcontext ck = gc.kind;
03048
03049 return ((ck == CX_FUNCTION) || (ck == CX_MACROFCN) || (ck == CX_INNER));
03050 }
|
|
|
Definition at line 1329 of file context.c. 01330 {
01331 return (gc.kind == CX_FCNDECL);
01332 }
|
|
|
Definition at line 3053 of file context.c. Referenced by context_getHeader(), context_getParams(), context_hasAccess(), context_hasMods(), exprChecks_checkEmptyMacroBody(), exprNode_checkMacroBody(), sRef_sameName(), sRef_unparse(), usymtab_enterScope(), usymtab_exitScope(), and usymtab_getParam(). 03054 {
03055 return (gc.kind == CX_FUNCTION || gc.kind == CX_MACROFCN
03056 || gc.kind == CX_UNKNOWNMACRO || gc.kind == CX_ITERDEF);
03057 }
|
|
|
Definition at line 3227 of file context.c. 03228 {
03229 if (gc.kind == CX_FUNCTION
03230 || gc.kind == CX_MACROFCN || gc.kind == CX_UNKNOWNMACRO
03231 || gc.kind == CX_MACROCONST
03232 || gc.kind == CX_ITERDEF || gc.kind == CX_ITEREND)
03233 {
03234 return (uentry_rawName (gc.cont.fcn));
03235 }
03236 else
03237 {
03238 llcontbuglit ("context_inFunctionName: not in function");
03239 return (cstring_undefined);
03240 }
03241 }
|
|
|
Definition at line 4050 of file context.c. 04051 {
04052 return (gc.kind == CX_GLOBAL);
04053 }
|
|
|
Definition at line 3837 of file context.c. Referenced by processNamedDecl(). 03838 {
03839 return (usymtab_inFileScope() || usymtab_inGlobalScope ());
03840 }
|
|
|
Definition at line 3929 of file context.c. Referenced by YY_RULE_SETUP(), exprNode_iterId(), modListArrayFetch(), modListArrowAccess(), modListFieldAccess(), and modListPointer(). 03930 {
03931 return (gc.inheader);
03932 }
|
|
|
Definition at line 3995 of file context.c. Referenced by makeEnumSpecNode(), sort_makeArr(), sort_makeEnum(), sort_makeHOFSort(), sort_makeImmutable(), sort_makeMutable(), sort_makePtr(), sort_makeSort(), sort_makeStr(), sort_makeSyn(), sort_makeTuple(), sort_makeUnion(), sort_makeUnionVal(), sort_makeVec(), symtable_enterTag(), and symtable_enterTagForce(). 03996 {
03997 return (gc.inimport);
03998 }
|
|
|
Definition at line 3842 of file context.c. Referenced by declareFunction(), and declareStaticFunction(). 03843 {
03844 return (gc.kind == CX_INNER);
03845 }
|
|
|
Definition at line 4018 of file context.c. Referenced by YY_RULE_SETUP(), context_exitFunction(), context_quietExitFunction(), exprNode_assign(), exprNode_for(), exprNode_iterStart(), exprNode_makeInitialization(), exprNode_while(), processNamedDecl(), and yyerror(). 04019 {
04020 return (gc.kind == CX_ITERDEF);
04021 }
|
|
|
Definition at line 4023 of file context.c. Referenced by YY_RULE_SETUP(), coerceId(), context_exitFunction(), context_quietExitFunction(), exprNode_fromUIO(), and yyerror(). 04024 {
04025 return (gc.kind == CX_ITEREND);
04026 }
|
|
|
Definition at line 3990 of file context.c. Referenced by doDeclareConstant(), and doDeclareVar(). 03991 {
03992 return (gc.kind == CX_LCLLIB);
03993 }
|
|
|
Definition at line 4011 of file context.c. Referenced by YY_RULE_SETUP(), checkPrefix(), context_exitFunction(), context_exitMacroCache(), exprNode_checkReturn(), exprNode_fromUIO(), exprNode_goto(), sRef_isMacroParamRef(), uentry_makeUnrecognized(), uentry_setUsed(), usymtab_allUsed(), usymtab_exitScope(), and yyerror(). 04012 {
04013 return (gc.kind == CX_MACROFCN || gc.kind == CX_MACROCONST
04014 || gc.kind == CX_UNKNOWNMACRO
04015 || gc.kind == CX_ITERDEF || gc.kind == CX_ITEREND);
04016 }
|
|
|
Definition at line 3954 of file context.c. Referenced by context_exitFunction(), context_quietExitFunction(), exprChecks_checkEmptyMacroBody(), and exprNode_checkMacroBody(). 03955 {
03956 return (gc.kind == CX_MACROCONST);
03957 }
|
|
|
Definition at line 3949 of file context.c. Referenced by exprNode_checkMacroBody(). 03950 {
03951 return (gc.kind == CX_MACROFCN);
03952 }
|
|
|
Definition at line 3959 of file context.c. Referenced by context_exitFunction(), context_quietExitFunction(), exprChecks_checkEmptyMacroBody(), exprNode_checkMacroBody(), and yyerror(). 03960 {
03961 return (gc.kind == CX_UNKNOWNMACRO);
03962 }
|
|
|
Definition at line 3914 of file context.c. Referenced by exprNode_arrowAccess(), exprNode_preOp(), and sRef_buildArrayFetch(). 03915 {
03916 return (gc.protectVars);
03917 }
|
|
|
Definition at line 3060 of file context.c. Referenced by declareFunction(), declareStaticFunction(), exprChecks_checkNullReturn(), exprNode_checkFunctionBody(), and exprNode_checkReturn(). 03061 {
03062 kcontext ck = gc.kind;
03063
03064 return ((ck == CX_FUNCTION) || (ck == CX_MACROFCN));
03065 }
|
|
|
Definition at line 362 of file context.c. Referenced by context_suppressFlagMsg(), context_suppressNotFlagMsg(), llgloberror(), and llhint(). 00363 {
00364 return (gc.insuppressregion);
00365 }
|
|
|
Definition at line 351 of file context.c. Referenced by context_suppressFlagMsg(), genppllerror(), genppllerrorhint(), and llhint(). 00352 {
00353 if (context_suppressSystemMsg (fl))
00354 {
00355 return TRUE;
00356 }
00357
00358 return (flagMarkerList_inIgnore (gc.markers, fl));
00359 }
|
|
|
Definition at line 2544 of file context.c. 02545 {
02546 int index = flagcode_valueIndex (flag);
02547
02548 llassert (index >= 0 && index <= NUMVALUEFLAGS);
02549 /* check limit */
02550 gc.counters[index]++;
02551 }
|
|
|
Definition at line 411 of file context.c. Referenced by YY_RULE_SETUP(). 00412 {
00413 gc.linesprocessed++;
00414 incLine ();
00415 }
|
|
|
Definition at line 2673 of file context.c. Referenced by main(). 02675 {
02676 gc.kind = CX_GLOBAL;
02677 gc.instandardlib = FALSE;
02678 gc.numerrors = 0;
02679 gc.neednl = FALSE;
02680 gc.linesprocessed = 0;
02681 gc.speclinesprocessed = 0;
02682 gc.insuppressregion = FALSE;
02683 gc.macroMissingParams = FALSE;
02684 gc.preprocessing = FALSE;
02685 gc.incommandline = FALSE;
02686 gc.mc = macrocache_create ();
02687 gc.nmods = 0;
02688 gc.maxmods = DEFAULTMAXMODS;
02689 gc.moduleaccess = (maccesst *)
02690 dmalloc (sizeof (*gc.moduleaccess) * (gc.maxmods));
02691
02692 gc.library = FLG_ANSILIB;
02693
02694 gc.locstack = filelocStack_new ();
02695 gc.modrecs = sRefSetList_undefined;
02696 gc.anyExports = FALSE;
02697
02698 gc.ftab = fileTable_create ();
02699 gc.msgLog = messageLog_new ();
02700 gc.inimport = FALSE;
02701 gc.inDerivedFile = FALSE;
02702 gc.inheader = FALSE;
02703 gc.markers = flagMarkerList_new ();
02704 gc.cont.glob = TRUE;
02705 gc.showfunction = FALSE;
02706 gc.msgAnnote = cstring_undefined;
02707 gc.aliasAnnote = sRef_undefined;
02708 gc.aliasAnnoteAls = sRef_undefined;
02709 gc.boolType = ctype_bool;
02710 gc.mods = sRefSet_new ();
02711
02712 gc.saveloc = fileloc_undefined;
02713
02714 gc.inmacrocache = FALSE;
02715 gc.inclause = NOCLAUSE;
02716 gc.clauses = clauseStack_new ();
02717 gc.globs = globSet_new ();
02718 gc.nacct = typeIdSet_emptySet ();
02719 gc.acct = typeIdSet_emptySet ();
02720 gc.facct = typeIdSet_emptySet ();
02721 gc.savedFlags = FALSE;
02722 gc.pushloc = fileloc_undefined;
02723 gc.protectVars = FALSE;
02724 gc.justpopped = FALSE;
02725 gc.isNullGuarded = NO;
02726 gc.globs_used = globSet_undefined;
02727
02728 allFlagCodes (code)
02729 {
02730 gc.setGlobally[code] = FALSE;
02731 gc.setLocally[code] = FALSE;
02732 } end_allFlagCodes ;
02733
02734 usymtab_initMod ();
02735
02736 context_resetAllFlags ();
02737 conext_resetAllCounters ();
02738 context_setMode (DEFAULT_MODE);
02739 }
|
|
|
Definition at line 209 of file context.c. Referenced by genppllerror(), and pplldiagmsg(). 00210 {
00211 return gc.incommandline;
00212 }
|
|
|
Definition at line 4128 of file context.c. Referenced by exprNode_checkMacroBody(). 04129 {
04130 return (gc.macroMissingParams);
04131 }
|
|
|
Definition at line 192 of file context.c. Referenced by closeMessage(), filelocStack_printIncludes(), and prepareMessage(). 00193 {
00194 return gc.preprocessing;
00195 }
|
|
|
Definition at line 1224 of file context.c. 01225 {
01226 char *ext = filenameExtension (cstring_toCharsSafe (fname));
01227
01228 return (mstring_equal (ext, ".y")
01229 || mstring_equal (ext, ".l")
01230 || cstring_equalLit (fname, "lex.yy.c"));
01231 }
|
|
|
Definition at line 1234 of file context.c. 01235 {
01236 cstring sysDirs = context_exposeString (FLG_SYSTEMDIRS);
01237 char *thisdir = cstring_toCharsSafe (sysDirs);
01238 char *nextdir = strchr (thisdir, SEPCHAR);
01239
01240 if (nextdir != NULL)
01241 {
01242 *nextdir = '\0';
01243 nextdir += 1;
01244 }
01245
01246 while (thisdir != NULL)
01247 {
01248 DPRINTF (("Test: %s / %s", dir, thisdir));
01249
01250 if (cstring_equalCanonicalPrefix (dir, thisdir))
01251 {
01252 if (nextdir != NULL)
01253 {
01254 *(nextdir - 1) = SEPCHAR;
01255 }
01256
01257 return TRUE;
01258 }
01259
01260 if (nextdir != NULL)
01261 {
01262 *(nextdir - 1) = SEPCHAR;
01263 }
01264
01265 if (nextdir != NULL)
01266 {
01267 thisdir = nextdir;
01268 nextdir = strchr (thisdir, SEPCHAR);
01269
01270 if (nextdir != NULL)
01271 {
01272 *nextdir = '\0';
01273 nextdir += 1;
01274 }
01275 }
01276 else
01277 {
01278 break;
01279 }
01280 }
01281
01282 DPRINTF (("Returns FALSE"));
01283 return FALSE;
01284 }
|
|
|
Definition at line 4113 of file context.c. Referenced by exprNode_fromIdentifier(). 04114 {
04115 return (gc.justpopped);
04116 }
|
|
|
Definition at line 4005 of file context.c. Referenced by processImport(). 04006 {
04007 gc.inimport = FALSE;
04008 }
|
|
|
Definition at line 577 of file context.c. Referenced by BUFLEN(). 00578 {
00579 char *s = mstring_create (MAX_DUMP_LINE_LENGTH);
00580 char *lasts = s;
00581 char *name = mstring_create (MAX_NAME_LENGTH);
00582 char *oname = name;
00583 # ifndef NOFREE
00584 char *os = s;
00585 # endif
00586
00587 while (fgets (s, MAX_DUMP_LINE_LENGTH, in) != NULL
00588 && *s == ';')
00589 {
00590 ;
00591 }
00592
00593 while (s != NULL && *s != ';' && *s != '\0')
00594 {
00595 name = oname;
00596
00597 while (*s != '#' && *s != '\0')
00598 {
00599 *name++ = *s++;
00600 }
00601
00602 *name = '\0';
00603
00604 if (*s != '#')
00605 {
00606 llcontbug (message ("context_loadModuleAccess: bad library line: %s\n",
00607 cstring_fromChars (s)));
00608 break;
00609 }
00610
00611 s++;
00612
00613 addModuleAccess (cstring_copy (cstring_fromChars (oname)),
00614 typeIdSet_undump (&s));
00615
00616 (void) fgets (s, MAX_DUMP_LINE_LENGTH, in);
00617 llassert (s != lasts);
00618 lasts = s;
00619 }
00620
00621 sfree (oname);
00622 # ifndef NOFREE
00623 sfree (os);
00624 # endif
00625 }
|
|
|
Definition at line 3667 of file context.c. Referenced by context_checkExport(), declareStruct(), declareUnion(), declareUnnamedStruct(), declareUnnamedUnion(), exprNode_checkMacroBody(), exprNode_checkStatement(), exprNode_for(), exprNode_if(), exprNode_ifelse(), exprNode_op(), exprNode_while(), main(), uentry_setUsed(), and usymtab_checkFinalScope(). 03668 {
03669 return (gc.flags[d] || gc.setLocally[d]);
03670 }
|
|
|
Definition at line 3944 of file context.c. 03945 {
03946 return gc.msgLog;
03947 }
|
|
|
Definition at line 1854 of file context.c. 01855 {
01856 return gc.mods;
01857 }
|
|
|
Definition at line 2302 of file context.c. 02303 {
02304 return (fileloc_getBase (g_currentloc));
02305 }
|
|
|
Definition at line 3793 of file context.c. Referenced by ctype_isBool(), ctype_isInt(), and ctype_isRegularInt(). 03794 {
03795 return gc.flags [FLG_BOOLINT];
03796 }
|
|
|
Definition at line 3798 of file context.c. Referenced by cprim_isInt(), ctype_isBool(), ctype_isInt(), and ctype_isRegularInt(). 03799 {
03800 return gc.flags [FLG_CHARINT];
03801 }
|
|
|
Definition at line 3803 of file context.c. Referenced by ctype_isInt(), ctype_isRealInt(), and ctype_isRegularInt(). 03804 {
03805 return gc.flags [FLG_ENUMINT];
03806 }
|
|
|
Definition at line 3819 of file context.c. Referenced by interfaceNode_makeFcn(), interfaceNode_makeType(), interfaceNode_makeVar(), and lhInit(). 03820 {
03821 return gc.flags [FLG_DOLH];
03822 }
|
|
|
Definition at line 3808 of file context.c. 03809 {
03810 return gc.flags [FLG_POINTERARITH];
03811 }
|
|
|
Definition at line 3813 of file context.c. Referenced by exprNode_preOp(). 03814 {
03815 return gc.flags [FLG_STRICTOPS];
03816 }
|
|
|
Definition at line 3867 of file context.c. Referenced by main(). 03868 {
03869 return gc.neednl;
03870 }
|
|
|
Definition at line 1443 of file context.c. Referenced by exprNode_break(). 01444 {
01445 bool hasOne = FALSE;
01446
01447 clauseStack_elements (gc.clauses, el)
01448 {
01449 if (clause_isBreakable (el))
01450 {
01451 if (hasOne)
01452 {
01453 return el;
01454 }
01455 else
01456 {
01457 hasOne = TRUE;
01458 }
01459 }
01460 } end_clauseStack_elements;
01461
01462 return NOCLAUSE;
01463 }
|
|
|
Definition at line 3862 of file context.c. Referenced by main(). 03863 {
03864 return gc.numerrors;
03865 }
|
|
|
Definition at line 3832 of file context.c. 03833 {
03834 gc.saveloc = fileloc_update (gc.saveloc, gc.pushloc);
03835 }
|
|
|
Definition at line 4066 of file context.c. 04067 {
04068 if (context_setBoolName ())
04069 {
04070 return context_getBoolName ();
04071 }
04072 else
04073 {
04074 return cstring_makeLiteralTemp ("boolean");
04075 }
04076 }
|
|
|
Definition at line 3068 of file context.c. Referenced by main(). 03069 {
03070 usymtab_enterFile ();
03071
03072 gc.inmacrocache = TRUE;
03073 macrocache_processUndefinedElements (gc.mc);
03074 cleanupMessages ();
03075 usymtab_exitFile ();
03076
03077 gc.inmacrocache = FALSE;
03078 macrocache_finalize ();
03079 }
|
|
|
Definition at line 4039 of file context.c. Referenced by LCLScanLine(). 04040 {
04041 gc.speclinesprocessed++;
04042 }
|
|
|
Definition at line 3118 of file context.c. Referenced by uentry_mergeDefinition(), and uentry_setDefined(). 03119 {
03120 return (gc.inmacrocache);
03121 }
|
|
|
Definition at line 3825 of file context.c. 03826 {
03827 fileloc_free (gc.pushloc);
03828 gc.pushloc = gc.saveloc;
03829 gc.saveloc = fileloc_undefined;
03830 }
|
|
|
Definition at line 2251 of file context.c. Referenced by declareFunction(), and declareStaticFunction(). 02252 {
02253 while (gc.kind == CX_INNER)
02254 {
02255 context_exitInnerPlain ();
02256 }
02257
02258 if (!context_inFunction () && !context_inMacroConstant () && !context_inMacroUnknown ()
02259 && !context_inIterDef () && !context_inIterEnd ())
02260 {
02261 }
02262 else
02263 {
02264 usymtab_quietExitScope (g_currentloc);
02265
02266 gc.showfunction = FALSE;
02267 gc.kind = CX_GLOBAL;
02268 gc.cont.glob = TRUE;
02269 gc.acct = gc.facct;
02270 gc.globs = globSet_new ();
02271 globSet_clear (gc.globs_used);
02272 gc.mods = sRefSet_new ();
02273
02274 sRef_exitFunctionScope ();
02275 }
02276 }
|
|
|
Definition at line 2454 of file context.c. Referenced by uentry_setGlobals(). 02455 {
02456 /*@access globSet@*/ context_recordFileModifies (mods); /*@noaccess globSet@*/
02457 }
|
|
|
Definition at line 2448 of file context.c. Referenced by context_recordFileGlobals(), and uentry_setModifies(). 02449 {
02450 gc.modrecs = sRefSetList_add (gc.modrecs, mods);
02451 }
|
|
|
Definition at line 3899 of file context.c. 03900 {
03901 llassert (gc.protectVars);
03902 gc.protectVars = FALSE;
03903 }
|
|
|
Definition at line 1306 of file context.c. 01307 {
01308 if (gc.kind == CX_FUNCTION || gc.kind == CX_MACROFCN
01309 || gc.kind == CX_UNKNOWNMACRO)
01310 {
01311 gc.acct = typeIdSet_removeFresh (gc.acct, t);
01312 }
01313
01314 gc.facct = typeIdSet_removeFresh (gc.facct, t);
01315 gc.nacct = typeIdSet_insert (gc.nacct, t);
01316 }
|
|
|
Definition at line 668 of file context.c. Referenced by context_initMod(). 00669 {
00670 allFlagCodes (code)
00671 {
00672 gc.flags[code] = FALSE;
00673
00674 if (flagcode_hasValue (code))
00675 {
00676 int val = 0;
00677
00678 /*@-loopswitchbreak@*/
00679 switch (code)
00680 {
00681 case FLG_LIMIT:
00682 val = DEFAULT_LIMIT; break;
00683 case FLG_LINELEN:
00684 val = DEFAULT_LINELEN; break;
00685 case FLG_EXTERNALNAMELEN:
00686 val = DEFAULT_EXTERNALNAMELEN; break;
00687 case FLG_INTERNALNAMELEN:
00688 val = DEFAULT_INTERNALNAMELEN; break;
00689 case FLG_COMMENTCHAR:
00690 val = (int) DEFAULT_COMMENTCHAR; break;
00691 case FLG_CONTROLNESTDEPTH:
00692 val = (int) DEFAULT_CONTROLNESTDEPTH; break;
00693 case FLG_STRINGLITERALLEN:
00694 val = (int) DEFAULT_STRINGLITERALLEN; break;
00695 case FLG_INCLUDENEST:
00696 val = (int) DEFAULT_INCLUDENEST; break;
00697 case FLG_NUMSTRUCTFIELDS:
00698 val = (int) DEFAULT_NUMSTRUCTFIELDS; break;
00699 case FLG_NUMENUMMEMBERS:
00700 val = (int) DEFAULT_NUMENUMMEMBERS; break;
00701 case FLG_EXPECT:
00702 case FLG_LCLEXPECT:
00703 break;
00704 default:
00705 llbug (message ("Bad value flag: %s", flagcode_unparse (code)));
00706 }
00707 /*@=loopswitchbreak@*/
00708
00709 context_setValue (code, val);
00710 }
00711 else if (flagcode_hasString (code))
00712 {
00713 cstring val = cstring_undefined;
00714
00715 switch (code)
00716 { /*@-loopswitchbreak@*/
00717 case FLG_LARCHPATH:
00718 {
00719 char *larchpath = osd_getEnvironmentVariable (LARCH_PATH);
00720
00721 if (larchpath != NULL)
00722 {
00723 val = cstring_fromCharsNew (larchpath);
00724 }
00725 else
00726 {
00727 val = cstring_makeLiteral (DEFAULT_LARCHPATH);
00728 }
00729
00730 break;
00731 }
00732 case FLG_LCLIMPORTDIR:
00733 {
00734 val = cstring_fromCharsNew (osd_getEnvironment (LCLIMPORTDIR, DEFAULT_LCLIMPORTDIR));
00735 break;
00736 }
00737 case FLG_TMPDIR:
00738 # if defined(OS2) || defined(MSDOS) || defined(WIN32)
00739 {
00740 char *env = osd_getEnvironmentVariable ("TMP");
00741
00742 if (env == NULL)
00743 {
00744 env = osd_getEnvironmentVariable ("TEMP");
00745 }
00746
00747 val = cstring_makeLiteral (env != NULL ? env : DEFAULT_TMPDIR);
00748 }
00749 # else
00750 val = cstring_makeLiteral (DEFAULT_TMPDIR);
00751 # endif /* !defined(OS2) && !defined(MSDOS) */
00752
00753 break;
00754 case FLG_BOOLTYPE:
00755 val = cstring_makeLiteral (DEFAULT_BOOLTYPE); break;
00756 case FLG_BOOLFALSE:
00757 val = cstring_makeLiteral ("FALSE"); break;
00758 case FLG_BOOLTRUE:
00759 val = cstring_makeLiteral ("TRUE"); break;
00760 case FLG_MACROVARPREFIX:
00761 val = cstring_makeLiteral ("m_"); break;
00762 case FLG_SYSTEMDIRS:
00763 val = cstring_makeLiteral (DEFAULT_SYSTEMDIR); break;
00764 default:
00765 break;
00766 } /*@=loopswitchbreak@*/
00767
00768 context_setString (code, val);
00769 }
00770 else
00771 {
00772 ; /* nothing to set */
00773 }
00774 } end_allFlagCodes;
00775
00776 /*
00777 ** These flags are true by default.
00778 */
00779
00780 gc.flags[FLG_MODIFIES] = TRUE;
00781 gc.flags[FLG_NESTCOMMENT] = TRUE;
00782 gc.flags[FLG_GLOBALS] = TRUE;
00783 gc.flags[FLG_FULLINITBLOCK] = TRUE;
00784 gc.flags[FLG_LIKELYBOOL] = TRUE;
00785 gc.flags[FLG_ZEROPTR] = TRUE;
00786 gc.flags[FLG_NUMLITERAL] = TRUE;
00787 gc.flags[FLG_DUPLICATEQUALS] = TRUE;
00788 gc.flags[FLG_SKIPANSIHEADERS] = TRUE;
00789 gc.flags[FLG_SKIPPOSIXHEADERS] = TRUE;
00790 gc.flags[FLG_SYSTEMDIREXPAND] = TRUE;
00791 gc.flags[FLG_UNRECOGCOMMENTS] = TRUE;
00792 gc.flags[FLG_CASTFCNPTR] = TRUE;
00793 gc.flags[FLG_DOLCS] = TRUE;
00794 gc.flags[FLG_USEVARARGS] = TRUE;
00795 gc.flags[FLG_MAINTYPE] = TRUE;
00796 gc.flags[FLG_SPECMACROS] = TRUE;
00797 gc.flags[FLG_REDEF] = TRUE;
00798 gc.flags[FLG_MACRONEXTLINE] = TRUE;
00799
00800 gc.flags[FLG_SIZEOFFORMALARRAY] = TRUE;
00801 gc.flags[FLG_FIXEDFORMALARRAY] = TRUE;
00802
00803 gc.flags[FLG_PREDASSIGN] = TRUE;
00804 gc.flags[FLG_MODOBSERVER] = TRUE;
00805 gc.flags[FLG_MACROVARPREFIXEXCLUDE] = TRUE;
00806 gc.flags[FLG_EXTERNALNAMECASEINSENSITIVE] = TRUE;
00807
00808 gc.flags[FLG_PARAMIMPTEMP] = TRUE;
00809 gc.flags[FLG_RETIMPONLY] = TRUE;
00810 gc.flags[FLG_GLOBIMPONLY] = TRUE;
00811 gc.flags[FLG_STRUCTIMPONLY] = TRUE;
00812 gc.flags[FLG_PREPROC] = TRUE;
00813 gc.flags[FLG_NAMECHECKS] = TRUE;
00814 gc.flags[FLG_FORMATCODE] = TRUE;
00815 gc.flags[FLG_FORMATTYPE] = TRUE;
00816 gc.flags[FLG_BADFLAG] = TRUE;
00817 gc.flags[FLG_WARNFLAGS] = TRUE;
00818 gc.flags[FLG_WARNUNIXLIB] = TRUE;
00819 gc.flags[FLG_WARNPOSIX] = TRUE;
00820 gc.flags[FLG_SHOWCOL] = TRUE;
00821 gc.flags[FLG_SHOWFUNC] = TRUE;
00822 gc.flags[FLG_SUPCOUNTS] = TRUE;
00823 gc.flags[FLG_HINTS] = TRUE;
00824 gc.flags[FLG_SYNTAX] = TRUE;
00825 gc.flags[FLG_TYPE] = TRUE;
00826 gc.flags[FLG_INCOMPLETETYPE] = TRUE;
00827 gc.flags[FLG_ABSTRACT] = TRUE;
00828 gc.flags[FLG_ITER] = TRUE;
00829 gc.flags[FLG_CONTROL] = TRUE;
00830 gc.flags[FLG_UNRECOG] = TRUE;
00831 gc.flags[FLG_SYSTEMUNRECOG] = TRUE;
00832 gc.flags[FLG_LINTCOMMENTS] = TRUE;
00833 gc.flags[FLG_ACCESSCZECH] = TRUE;
00834 gc.flags[FLG_ACCESSMODULE] = TRUE;
00835 gc.flags[FLG_ACCESSFILE] = TRUE;
00836 gc.flags[FLG_MACROVARPREFIX] = TRUE;
00837
00838 /*
00839 ** Changed for version 2.4.
00840 */
00841
00842 gc.flags[FLG_GNUEXTENSIONS] = TRUE;
00843
00844 /*
00845 ** On by default for Win32, but not Unix (to support MS/VC++ error message format).
00846 */
00847
00848 # ifdef WIN32
00849 gc.flags[FLG_PARENFILEFORMAT] = TRUE;
00850 # endif
00851 }
|
|
|
Definition at line 2668 of file context.c. Referenced by main(). 02669 {
02670 gc.numerrors = 0;
02671 }
|
|
|
Definition at line 4123 of file context.c. 04124 {
04125 gc.macroMissingParams = FALSE;
04126 }
|
|
|
Definition at line 633 of file context.c. Referenced by context_setMode(), and describeModes(). 00634 {
00635
00636 allFlagCodes (code)
00637 {
00638 if (flagcode_isModeFlag (code))
00639 {
00640 context_setFlag (code, FALSE);
00641 }
00642 } end_allFlagCodes;
00643
00644 }
|
|
|
Definition at line 4044 of file context.c. 04045 {
04046 gc.speclinesprocessed = 0;
04047 }
|
|
|
Definition at line 2191 of file context.c. Referenced by exprNode_checkFunctionBody(), exprNode_nullReturn(), and exprNode_return(). 02192 {
02193 usymtab_checkFinalScope (TRUE);
02194 }
|
|
|
Definition at line 3208 of file context.c. Referenced by YY_RULE_SETUP(). 03209 {
03210 /* was llassert (fileloc_isUndefined (gc.saveloc)) */
03211 fileloc_free (gc.saveloc);
03212
03213
03214 gc.saveloc = fileloc_copy (g_currentloc);
03215 }
|
|
|
Definition at line 555 of file context.c. 00556 {
00557 switch (gc.library)
00558 {
00559 case FLG_STRICTLIB:
00560 return LLSTRICTLIBS_NAME;
00561 case FLG_POSIXLIB:
00562 return LLPOSIXLIBS_NAME;
00563 case FLG_POSIXSTRICTLIB:
00564 return LLPOSIXSTRICTLIBS_NAME;
00565 case FLG_UNIXLIB:
00566 return LLUNIXLIBS_NAME;
00567 case FLG_UNIXSTRICTLIB:
00568 return LLUNIXSTRICTLIBS_NAME;
00569 case FLG_ANSILIB:
00570 return LLSTDLIBS_NAME;
00571 BADDEFAULT;
00572 }
00573 }
|
|
|
Definition at line 2415 of file context.c. 02416 {
02417 llassert (sRef_isInvalid (gc.aliasAnnote));
02418 llassert (!sRef_sameName (s, t));
02419 gc.aliasAnnote = s;
02420 gc.aliasAnnoteAls = t;
02421 }
|
|
|
Definition at line 4060 of file context.c. Referenced by context_printBoolName(). 04061 {
04062 return (!cstring_equalLit (context_getString (FLG_BOOLTYPE),
04063 DEFAULT_BOOLTYPE));
04064 }
|
|
|
Definition at line 2460 of file context.c. Referenced by setValueFlag(). 02461 {
02462 llassert (c != '\0');
02463
02464 context_setValue (FLG_COMMENTCHAR, (int) c);
02465 }
|
|
|
Definition at line 4055 of file context.c. Referenced by main(). 04056 {
04057 g_currentloc = fileloc_updateFileId (g_currentloc, s);
04058 }
|
|
|
Definition at line 3692 of file context.c. 03695 {
03696 if (fileId_baseEqual (currentFile (), fid))
03697 {
03698 setLine (lineno);
03699 return;
03700 }
03701 else
03702 {
03703 fileloc_setColumn (g_currentloc, 0);
03704
03705 if (fileloc_isSpecialFile (g_currentloc))
03706 {
03707 gc.inDerivedFile = TRUE;
03708 }
03709
03710 if (filelocStack_popPushFile (gc.locstack, g_currentloc))
03711 {
03712 int maxdepth = context_getValue (FLG_INCLUDENEST);
03713
03714 if (filelocStack_size (gc.locstack) > maxdepth)
03715 {
03716 int depth = filelocStack_includeDepth (gc.locstack);
03717
03718 if (depth > maxdepth)
03719 {
03720 if (optgenerror
03721 (FLG_INCLUDENEST,
03722 message ("Maximum include nesting depth "
03723 "(%d, current depth %d) exceeded",
03724 maxdepth,
03725 depth),
03726 filelocStack_nextTop (gc.locstack)))
03727 {
03728 filelocStack_printIncludes (gc.locstack);
03729 }
03730 }
03731 }
03732 }
03733
03734 g_currentloc = fileloc_create (fid, lineno, 1);
03735 gc.inheader = fileId_isHeader (currentFile ());
03736
03737 context_enterFileAux ();
03738 }
03739 }
|
|
|
Definition at line 3376 of file context.c. Referenced by ctype_matchDef(). 03377 {
03378 DPRINTF (("Set flag temp: %s / %s", flagcode_unparse (f), bool_unparse (b)));
03379 gc.flags[f] = b;
03380 }
|
|
|
Definition at line 1621 of file context.c. 01622 {
01623 switch (gc.kind)
01624 {
01625 case CX_UNKNOWNMACRO:
01626 case CX_FUNCTION:
01627 case CX_MACROFCN:
01628 uentry_setFunctionDefined (gc.cont.fcn, loc);
01629 break;
01630 default:
01631 /* (not a bug because of parse errors) */
01632 break;
01633 }
01634 }
|
|
|
Definition at line 197 of file context.c. Referenced by main(). 00198 {
00199 llassert (!gc.incommandline);
00200 gc.incommandline = TRUE;
00201 }
|
|
|
Definition at line 550 of file context.c. Referenced by BUFLEN(). 00551 {
00552 gc.library = code;
00553 }
|
|
|
Definition at line 4118 of file context.c. 04119 {
04120 gc.macroMissingParams = TRUE;
04121 }
|
|
|
Definition at line 2383 of file context.c. Referenced by exprNode_for(). 02384 {
02385 llassert (cstring_isUndefined (gc.msgAnnote));
02386 gc.msgAnnote = s;
02387 }
|
|
|
Definition at line 867 of file context.c. Referenced by context_initMod(), describeModes(), and main(). 00868 {
00869 intSet setflags = intSet_new ();
00870
00871 allFlagCodes (code)
00872 {
00873 if (flagcode_isModeFlag (code))
00874 {
00875 if (gc.setGlobally[code])
00876 {
00877 (void) intSet_insert (setflags, (int) code);
00878 }
00879 }
00880 } end_allFlagCodes;
00881
00882 if (!intSet_isEmpty (setflags))
00883 {
00884 cstring rflags = cstring_undefined;
00885 int num = 0;
00886
00887 intSet_elements (setflags, el)
00888 {
00889 if (cstring_isUndefined (rflags))
00890 {
00891 rflags = cstring_copy (flagcode_unparse ((flagcode) (el)));
00892 }
00893 else
00894 {
00895 rflags = message ("%q, %s", rflags,
00896 flagcode_unparse ((flagcode) el));
00897 }
00898
00899 num++;
00900 if (num > 4 && intSet_size (setflags) > 6)
00901 {
00902 rflags = message ("%q, (%d others) ...", rflags,
00903 intSet_size (setflags) - num);
00904 break;
00905 }
00906 } end_intSet_elements ;
00907
00908 voptgenerror (FLG_WARNFLAGS,
00909 message ("Setting mode %s after setting mode flags will "
00910 "override set values of flags: %s",
00911 s, rflags),
00912 g_currentloc);
00913
00914 cstring_free (rflags);
00915 }
00916
00917 intSet_free (setflags);
00918
00919 context_resetModeFlags ();
00920
00921 if (cstring_equalLit (s, "standard"))
00922 {
00923 flagcode modeflags[] =
00924 {
00925 FLG_ENUMINT, FLG_MACROMATCHNAME,
00926 FLG_MACROUNDEF, FLG_RELAXQUALS,
00927 FLG_USEALLGLOBS, FLG_CHECKSTRICTGLOBALS,
00928 FLG_CHECKSTRICTGLOBALIAS,
00929 FLG_CHECKEDGLOBALIAS,
00930 FLG_CHECKMODGLOBALIAS,
00931 FLG_PREDBOOLOTHERS, FLG_PREDBOOLINT,
00932 FLG_PARAMUNUSED, FLG_VARUNUSED, FLG_FUNCUNUSED,
00933 FLG_TYPEUNUSED,
00934 FLG_CONSTUNUSED, FLG_ENUMMEMUNUSED, FLG_FIELDUNUSED,
00935 FLG_PTRNUMCOMPARE, FLG_BOOLCOMPARE, FLG_MUTREP,
00936 FLG_NOEFFECT, FLG_IMPTYPE,
00937 FLG_RETVALOTHER, FLG_RETVALBOOL, FLG_RETVALINT,
00938 FLG_SPECUNDEF, FLG_INCONDEFS, FLG_INCONDEFSLIB,
00939 FLG_MATCHFIELDS,
00940 FLG_MACROPARAMS, FLG_MACROASSIGN, FLG_SEFPARAMS,
00941 FLG_MACROSTMT, FLG_MACROPARENS,
00942 FLG_MACROFCNDECL,
00943 FLG_MACROCONSTDECL,
00944 FLG_MACROREDEF, FLG_INFLOOPS, FLG_UNREACHABLE,
00945 FLG_NORETURN, FLG_CASEBREAK, FLG_MISSCASE, FLG_USEDEF,
00946 FLG_FIRSTCASE,
00947 FLG_NESTEDEXTERN,
00948 FLG_NUMLITERAL,
00949 FLG_ZEROBOOL,
00950 /* memchecks flags */
00951 FLG_NULLDEREF,
00952 FLG_NULLSTATE, FLG_NULLASSIGN,
00953 FLG_NULLPASS, FLG_NULLRET,
00954
00955 FLG_COMPDEF, FLG_COMPMEMPASS, FLG_UNIONDEF,
00956 FLG_RETSTACK,
00957
00958 /* memtrans flags */
00959 FLG_EXPOSETRANS,
00960 FLG_OBSERVERTRANS,
00961 FLG_DEPENDENTTRANS,
00962 FLG_NEWREFTRANS,
00963 FLG_ONLYTRANS,
00964 FLG_OWNEDTRANS,
00965 FLG_FRESHTRANS,
00966 FLG_SHAREDTRANS,
00967 FLG_TEMPTRANS,
00968 FLG_KEPTTRANS,
00969 FLG_REFCOUNTTRANS,
00970 FLG_STATICTRANS,
00971 FLG_UNKNOWNTRANS,
00972 FLG_KEEPTRANS,
00973 FLG_IMMEDIATETRANS,
00974
00975 FLG_EXPORTLOCAL,
00976
00977 FLG_USERELEASED, FLG_ALIASUNIQUE, FLG_MAYALIASUNIQUE,
00978 FLG_MUSTFREE, FLG_MUSTDEFINE, FLG_GLOBSTATE,
00979 FLG_COMPDESTROY, FLG_MUSTNOTALIAS,
00980 FLG_MEMIMPLICIT,
00981 FLG_BRANCHSTATE,
00982
00983 FLG_EVALORDER, FLG_SHADOW, FLG_READONLYSTRINGS,
00984 FLG_EXITARG,
00985 FLG_IMPCHECKEDSPECGLOBALS,
00986 FLG_MODGLOBS, FLG_WARNLINTCOMMENTS,
00987 FLG_IFEMPTY, FLG_REALCOMPARE,
00988 FLG_BOOLOPS, FLG_PTRNEGATE,
00989 FLG_SHIFTSIGNED,
00990 INVALID_FLAG } ;
00991
00992 SETFLAGS ();
00993 }
00994 else if (cstring_equalLit (s, "weak"))
00995 {
00996 flagcode modeflags[] =
00997 {
00998 FLG_BOOLINT, FLG_CHARINT, FLG_FLOATDOUBLE,
00999 FLG_ENUMINT, FLG_RELAXQUALS, FLG_FORWARDDECL,
01000 FLG_CHARINDEX, FLG_ABSTVOIDP, FLG_USEALLGLOBS,
01001 FLG_CHARUNSIGNEDCHAR,
01002 FLG_PREDBOOLOTHERS,
01003 FLG_VARUNUSED, FLG_FUNCUNUSED,
01004 FLG_TYPEUNUSED,
01005 FLG_CHECKSTRICTGLOBALS, FLG_MACROMATCHNAME,
01006 FLG_RETVALOTHER,
01007 FLG_IFEMPTY,
01008 FLG_RETSTACK, FLG_PTRNEGATE,
01009 FLG_LONGUNSIGNEDINTEGRAL,
01010 FLG_LONGUNSIGNEDUNSIGNEDINTEGRAL,
01011 FLG_NUMLITERAL,
01012 FLG_CHARINTLITERAL,
01013 FLG_ZEROBOOL,
01014 INVALID_FLAG
01015 } ;
01016
01017 SETFLAGS ();
01018 }
01019 else if (cstring_equalLit (s, "checks"))
01020 {
01021 flagcode modeflags[] =
01022 {
01023 FLG_EXPORTLOCAL, FLG_IMPTYPE,
01024 FLG_CHECKSTRICTGLOBALIAS,
01025 FLG_CHECKEDGLOBALIAS,
01026 FLG_CHECKMODGLOBALIAS,
01027 FLG_UNCHECKEDGLOBALIAS,
01028 FLG_EXITARG, FLG_PTRNUMCOMPARE,
01029 FLG_BOOLCOMPARE, FLG_MACROUNDEF,
01030 FLG_MUSTMOD, FLG_ALLGLOBALS,
01031 FLG_PREDBOOLOTHERS, FLG_PREDBOOLPTR, FLG_PREDBOOLINT,
01032 FLG_USEALLGLOBS, FLG_MUTREP, FLG_RETALIAS,
01033 FLG_RETEXPOSE, FLG_ASSIGNEXPOSE, FLG_CASTEXPOSE,
01034 FLG_FUNCUNUSED, FLG_GLOBALSIMPMODIFIESNOTHING,
01035 FLG_TYPEUNUSED, FLG_FIELDUNUSED, FLG_PARAMUNUSED, FLG_VARUNUSED,
01036 FLG_CONSTUNUSED, FLG_ENUMMEMUNUSED,
01037 FLG_NOEFFECT, FLG_EXPORTHEADER, FLG_EXPORTHEADERVAR,
01038 FLG_RETVALOTHER, FLG_RETVALBOOL, FLG_RETVALINT,
01039 FLG_SPECUNDEF, FLG_IMPCHECKMODINTERNALS,
01040 FLG_DECLUNDEF, FLG_INCONDEFS, FLG_INCONDEFSLIB,
01041 FLG_MATCHFIELDS,
01042 FLG_MACROPARAMS,
01043 FLG_MACROASSIGN,
01044 FLG_DECLPARAMMATCH,
01045 FLG_FCNDEREF,
01046 FLG_FIRSTCASE,
01047 FLG_SEFPARAMS, FLG_SEFUNSPEC, FLG_MACROSTMT, FLG_MACROPARENS,
01048 FLG_MACROCONSTDECL,
01049 FLG_MACROFCNDECL,
01050 FLG_MACROREDEF,
01051 FLG_INFLOOPS, FLG_INFLOOPSUNCON,
01052 FLG_UNREACHABLE,
01053 FLG_NORETURN, FLG_CASEBREAK, FLG_MISSCASE,
01054 FLG_EVALORDER, FLG_USEDEF,
01055
01056 FLG_NESTEDEXTERN,
01057
01058 /* memchecks flags */
01059
01060 FLG_NULLSTATE, FLG_NULLDEREF, FLG_NULLASSIGN,
01061 FLG_NULLPASS, FLG_NULLRET,
01062
01063 FLG_COMPDEF, FLG_COMPMEMPASS, FLG_UNIONDEF, FLG_RETSTACK,
01064
01065 /* memtrans flags */
01066 FLG_EXPOSETRANS,
01067 FLG_OBSERVERTRANS,
01068 FLG_DEPENDENTTRANS,
01069 FLG_NEWREFTRANS,
01070 FLG_ONLYTRANS,
01071 FLG_OWNEDTRANS,
01072 FLG_FRESHTRANS,
01073 FLG_SHAREDTRANS,
01074 FLG_TEMPTRANS,
01075 FLG_KEPTTRANS,
01076 FLG_REFCOUNTTRANS,
01077 FLG_STATICTRANS,
01078 FLG_UNKNOWNTRANS,
01079 FLG_STATICINITTRANS,
01080 FLG_UNKNOWNINITTRANS,
01081 FLG_KEEPTRANS,
01082 FLG_IMMEDIATETRANS,
01083 FLG_ONLYUNQGLOBALTRANS,
01084 FLG_USERELEASED, FLG_ALIASUNIQUE, FLG_MAYALIASUNIQUE,
01085 FLG_MUSTFREE, FLG_MUSTDEFINE, FLG_GLOBSTATE,
01086 FLG_COMPDESTROY, FLG_MUSTNOTALIAS,
01087 FLG_MEMIMPLICIT,
01088 FLG_BRANCHSTATE,
01089 FLG_NULLPOINTERARITH,
01090 FLG_SHADOW, FLG_DEPARRAYS,
01091 FLG_REDECL, FLG_READONLYSTRINGS, FLG_READONLYTRANS,
01092 FLG_LOOPLOOPBREAK, FLG_SWITCHLOOPBREAK, FLG_MODGLOBS,
01093 FLG_CHECKSTRICTGLOBALS, FLG_IMPCHECKEDSPECGLOBALS,
01094 FLG_MACROMATCHNAME, FLG_WARNLINTCOMMENTS,
01095 FLG_INCLUDENEST, FLG_ANSIRESERVED, FLG_CPPNAMES,
01096 FLG_NOPARAMS, FLG_IFEMPTY, FLG_WHILEEMPTY, FLG_REALCOMPARE,
01097 FLG_BOOLOPS, FLG_SHIFTSIGNED,
01098 INVALID_FLAG } ;
01099
01100 SETFLAGS ();
01101 }
01102 else if (cstring_equalLit (s, "strict"))
01103 {
01104 flagcode modeflags[] =
01105 {
01106 FLG_CHECKSTRICTGLOBALIAS,
01107 FLG_CHECKEDGLOBALIAS,
01108 FLG_CHECKMODGLOBALIAS,
01109 FLG_UNCHECKEDGLOBALIAS,
01110 FLG_MODFILESYSTEM,
01111 FLG_MACROMATCHNAME,
01112 FLG_MACROUNDEF, FLG_MUTREP, FLG_MUSTMOD,
01113 FLG_ALLGLOBALS, FLG_IMPTYPE,
01114 FLG_MODNOMODS, FLG_MODGLOBSUNSPEC, FLG_MODSTRICTGLOBSUNSPEC,
01115 FLG_GLOBUNSPEC, FLG_SIZEOFTYPE,
01116 FLG_EXPORTHEADER, FLG_EXPORTHEADERVAR,
01117 FLG_NOPARAMS, FLG_OLDSTYLE, FLG_EXITARG,
01118 FLG_RETSTACK,
01119 FLG_FCNDEREF,
01120 FLG_ONLYUNQGLOBALTRANS,
01121 FLG_GLOBALSIMPMODIFIESNOTHING,
01122 FLG_PREDBOOLOTHERS, FLG_PREDBOOLPTR, FLG_PREDBOOLINT,
01123 FLG_INTERNALGLOBS, FLG_INTERNALGLOBSNOGLOBS,
01124 FLG_USEALLGLOBS, FLG_RETALIAS,
01125 FLG_MODGLOBS, FLG_MODGLOBSUNSPEC, FLG_MODGLOBSUNCHECKED,
01126 FLG_RETEXPOSE, FLG_ASSIGNEXPOSE, FLG_CASTEXPOSE,
01127 FLG_NOEFFECTUNCON, FLG_EVALORDERUNCON,
01128 FLG_FUNCUNUSED,
01129 FLG_EXPORTITER, FLG_EXPORTCONST,
01130 FLG_TYPEUNUSED, FLG_FIELDUNUSED, FLG_PARAMUNUSED, FLG_TOPUNUSED,
01131 FLG_CONSTUNUSED, FLG_ENUMMEMUNUSED,
01132 FLG_VARUNUSED,
01133 FLG_NULLPOINTERARITH, FLG_POINTERARITH,
01134 FLG_PTRNUMCOMPARE,
01135 FLG_BOOLCOMPARE, FLG_NOEFFECT,
01136 FLG_RETVALINT, FLG_RETVALBOOL, FLG_RETVALOTHER,
01137 FLG_ANSIRESERVED, FLG_ANSIRESERVEDLOCAL, FLG_CPPNAMES,
01138 FLG_RETVALBOOL, FLG_RETVALINT, FLG_SPECUNDEF,
01139 FLG_DECLUNDEF, FLG_STRICTOPS, FLG_INCONDEFS,
01140 FLG_INCONDEFSLIB, FLG_MATCHFIELDS, FLG_EXPORTMACRO, FLG_EXPORTVAR,
01141 FLG_EXPORTFCN, FLG_EXPORTTYPE, FLG_EXPORTLOCAL, FLG_MACROPARAMS,
01142 FLG_MACROASSIGN,
01143 FLG_SEFPARAMS, FLG_SEFUNSPEC, FLG_MACROSTMT, FLG_MACROPARENS,
01144 FLG_MACROFCNDECL,
01145 FLG_MACROCONSTDECL,
01146 FLG_MACROREDEF, FLG_MACROEMPTY,
01147 FLG_INFLOOPS, FLG_INFLOOPSUNCON,
01148 FLG_UNREACHABLE,
01149 FLG_NORETURN, FLG_CASEBREAK, FLG_MISSCASE, FLG_USEDEF,
01150 FLG_EVALORDER,
01151 FLG_MODUNCON, FLG_MODUNCONNOMODS, FLG_MODINTERNALSTRICT,
01152 FLG_MODOBSERVERUNCON,
01153
01154 FLG_NESTEDEXTERN,
01155 FLG_FIRSTCASE,
01156
01157 /* memchecks flags */
01158 FLG_NULLSTATE, FLG_NULLDEREF, FLG_NULLASSIGN,
01159 FLG_NULLPASS, FLG_NULLRET,
01160
01161 FLG_COMPDEF, FLG_COMPMEMPASS, FLG_UNIONDEF,
01162
01163 /* memtrans flags */
01164 FLG_EXPOSETRANS,
01165 FLG_OBSERVERTRANS,
01166 FLG_DEPENDENTTRANS,
01167 FLG_NEWREFTRANS,
01168 FLG_ONLYTRANS,
01169 FLG_OWNEDTRANS,
01170 FLG_FRESHTRANS,
01171 FLG_SHAREDTRANS,
01172 FLG_TEMPTRANS,
01173 FLG_KEPTTRANS,
01174 FLG_REFCOUNTTRANS,
01175 FLG_STATICTRANS,
01176 FLG_UNKNOWNTRANS,
01177 FLG_KEEPTRANS,
01178 FLG_IMMEDIATETRANS,
01179 FLG_STATICINITTRANS,
01180 FLG_UNKNOWNINITTRANS,
01181
01182 FLG_USERELEASED, FLG_ALIASUNIQUE, FLG_MAYALIASUNIQUE,
01183 FLG_MUSTFREE, FLG_MUSTDEFINE, FLG_GLOBSTATE,
01184 FLG_COMPDESTROY, FLG_MUSTNOTALIAS,
01185 FLG_MEMIMPLICIT,
01186 FLG_BRANCHSTATE,
01187
01188 FLG_DECLPARAMNAME, FLG_DECLPARAMMATCH,
01189
01190 FLG_SHADOW, FLG_DEPARRAYS,
01191 FLG_STRICTDESTROY, FLG_STRICTUSERELEASED, FLG_STRICTBRANCHSTATE,
01192 FLG_REDECL, FLG_READONLYSTRINGS, FLG_READONLYTRANS,
01193 FLG_LOOPLOOPBREAK, FLG_LOOPSWITCHBREAK, FLG_SWITCHLOOPBREAK,
01194 FLG_SWITCHSWITCHBREAK, FLG_LOOPLOOPCONTINUE,
01195 FLG_CHECKSTRICTGLOBALS, FLG_IMPCHECKEDSPECGLOBALS,
01196 FLG_ALLGLOBALS, FLG_IMPCHECKEDSTRICTGLOBALS,
01197 FLG_IMPCHECKEDSTRICTSTATICS,
01198 FLG_IMPCHECKEDSTRICTSPECGLOBALS,
01199 FLG_IMPCHECKMODINTERNALS,
01200 FLG_WARNMISSINGGLOBALS, FLG_WARNMISSINGGLOBALSNOGLOBS,
01201 FLG_WARNLINTCOMMENTS, FLG_ANSIRESERVEDLOCAL,
01202 FLG_INCLUDENEST, FLG_STRINGLITERALLEN,
01203 FLG_NUMSTRUCTFIELDS, FLG_NUMENUMMEMBERS,
01204 FLG_CONTROLNESTDEPTH,
01205 FLG_FORBLOCK, FLG_WHILEBLOCK,
01206 FLG_FOREMPTY, FLG_WHILEEMPTY,
01207 FLG_IFEMPTY, FLG_IFBLOCK,
01208 FLG_ELSEIFCOMPLETE,
01209 FLG_REALCOMPARE, FLG_BOOLOPS,
01210 FLG_SYSTEMDIRERRORS, FLG_UNUSEDSPECIAL,
01211
01212 FLG_SHIFTSIGNED, FLG_BITWISEOPS,
01213 INVALID_FLAG } ;
01214
01215 SETFLAGS ();
01216 }
01217 else
01218 {
01219 llcontbug (message ("context_setMode: bad mode: %s", s));
01220 }
01221 }
|
|
|
Definition at line 3872 of file context.c. Referenced by lldiagmsg(), llgloberror(), llmsg(), and llmsgplain(). 03873 {
03874 gc.neednl = TRUE;
03875 }
|
|
|
Definition at line 180 of file context.c. Referenced by filelocStack_printIncludes(), genppllerrorhint(), and main(). 00181 {
00182 llassert (!gc.preprocessing);
00183 gc.preprocessing = TRUE;
00184 }
|
|
|
Definition at line 3847 of file context.c. 03848 {
03849 gc.protectVars = TRUE;
03850 }
|
|
|
Definition at line 3964 of file context.c. 03965 {
03966 gc.showfunction = FALSE;
03967 }
|
|
|
Definition at line 2568 of file context.c. Referenced by context_resetAllFlags(), main(), and setStringFlag(). 02569 {
02570 int index = flagcode_stringIndex (flag);
02571
02572 llassert (index >= 0 && index <= NUMSTRINGFLAGS);
02573
02574 if (flag == FLG_SYSTEMDIRS)
02575 {
02576 llassert (cstring_isDefined (val));
02577
02578 if (cstring_firstChar (val) == '\"')
02579 {
02580 cstring oval = val;
02581 cstring tval = cstring_copy (cstring_suffix (val, 1));
02582
02583 if (cstring_lastChar (tval) != '\"')
02584 {
02585 int n = cstring_length (tval) - 1;
02586
02587 while (isspace ((int) cstring_getChar (tval, n)))
02588 {
02589 n--;
02590 }
02591
02592 if (cstring_getChar (tval, n) != '\"')
02593 {
02594 cstring msg = message ("Setting -systemdirs to string with unmatching quotes: %s", val);
02595 flagWarning (msg);
02596 cstring_free (msg);
02597 }
02598 else
02599 {
02600 cstring otval = tval;
02601 tval = cstring_prefix (tval, n);
02602 cstring_free (otval);
02603 }
02604 }
02605
02606 val = cstring_copy (cstring_clip (tval, cstring_length (tval) - 1));
02607 DPRINTF (("val = %s", val));
02608 cstring_free (tval);
02609 cstring_free (oval);
02610 }
02611 }
02612
02613 if (flag == FLG_TMPDIR)
02614 {
02615 llassert (cstring_isDefined (val));
02616
02617 if (cstring_length (val) == 0)
02618 {
02619 cstring_free (val);
02620 val = message (".%s", cstring_makeLiteralTemp (CONNECTSTR));
02621 }
02622 else if (cstring_lastChar (val) != CONNECTCHAR)
02623 {
02624 val = cstring_appendChar (val, CONNECTCHAR);
02625 }
02626 else
02627 {
02628 ;
02629 }
02630 }
02631
02632 if (cstring_length (val) >= 1
02633 && cstring_firstChar (val) == '"')
02634 {
02635 cstring s = message
02636 ("setting %s to string beginning with \". You probably "
02637 "don't meant to have the \"'s.",
02638 flagcode_unparse (flag));
02639
02640 flagWarning (s);
02641 cstring_free (s);
02642 }
02643
02644 if (flag == FLG_BOOLTYPE)
02645 {
02646
02647 }
02648
02649 gc.strings[index] = val;
02650 }
|
|
|
Definition at line 2519 of file context.c. Referenced by setValueFlag(). 02520 {
02521 gc.flags[flag] = TRUE;
02522 context_setValue (flag, val);
02523 }
|
|
|
Definition at line 4133 of file context.c. 04134 {
04135 filelocStack_printIncludes (gc.locstack);
04136 }
|
|
|
Definition at line 2562 of file context.c. 02563 {
02564 return (gc.showfunction);
02565 }
|
|
|
Definition at line 3905 of file context.c. 03906 {
03907 /* If there is a nested sizeof, this might not hold:
03908 llassert (gc.protectVars);
03909 */
03910
03911 gc.protectVars = FALSE;
03912 }
|
|
|
Definition at line 306 of file context.c. Referenced by llgenhinterror(), optgenerror2(), and optgenerror2n(). 00307 {
00308 if (context_suppressSystemMsg (fl))
00309 {
00310 return TRUE;
00311 }
00312
00313 /* want same object compare here */
00314
00315 if (fileloc_equal (fl, g_currentloc) || gc.inDerivedFile)
00316 {
00317 return (!context_getFlag (flag)
00318 || context_inSuppressRegion ()
00319 || context_inSuppressZone (fl)
00320 || (gc.inDerivedFile && context_inSuppressFlagZone (fl, flag)));
00321 }
00322 else
00323 {
00324 return (context_inSuppressFlagZone (fl, flag));
00325 }
00326 }
|
|
|
Definition at line 329 of file context.c. Referenced by optgenerror2n(). 00330 {
00331
00332 if (context_suppressSystemMsg (fl))
00333 {
00334 return TRUE;
00335 }
00336
00337 /*@access fileloc@*/
00338 if (fl == g_currentloc)
00339 /*@noaccess fileloc@*/
00340 {
00341 return (context_getFlag (flag) || context_inSuppressRegion ());
00342 }
00343 else
00344 {
00345 /* for now... */
00346 return (context_getFlag (flag) || context_inSuppressRegion ());
00347 }
00348 }
|
|
|
Definition at line 3939 of file context.c. 03940 {
03941 return (context_getString (FLG_TMPDIR));
03942 }
|
|
|
Definition at line 2759 of file context.c. 02760 {
02761 ctype ct = ctype_int;
02762
02763 /* 1 is on longer a bool (was before 2.4)
02764 if (!context_getFlag (FLG_ABSTRACTBOOL))
02765 {
02766 ct = ctype_makeConj (ct, ctype_bool);
02767 }
02768 */
02769
02770 return (ct);
02771 }
|
|
|
Definition at line 2742 of file context.c. 02743 {
02744 ctype ct = ctype_int;
02745
02746 if (context_getFlag (FLG_ZEROPTR))
02747 {
02748 ct = ctype_makeConj (ct, ctype_voidPointer);
02749 }
02750
02751 if (context_getFlag (FLG_ZEROBOOL)) {
02752 ct = ctype_makeConj (ct, ctype_bool);
02753 }
02754
02755 return ct;
02756 }
|
|
|
Definition at line 3924 of file context.c. Referenced by loadStandardState(). 03925 {
03926 gc.flags[FLG_SHOWSCAN] = TRUE;
03927 }
|
|
|
Definition at line 3894 of file context.c. Referenced by cleanupMessages(). 03895 {
03896 return (context_getLimit () < 0);
03897 }
|
|
|
Definition at line 2774 of file context.c. Referenced by exprNode_checkMacroBody(). 02775 {
02776 cstring s;
02777
02778 switch (gc.kind)
02779 {
02780 case CX_LCL:
02781 s = message ("LCL File: %q", fileloc_unparse (g_currentloc));
02782 break;
02783 case CX_LCLLIB:
02784 s = message ("LCL Lib File: %q", fileloc_unparse (g_currentloc));
02785 break;
02786 case CX_GLOBAL:
02787 s = message ("Global Context:%q", fileloc_unparse (g_currentloc));
02788 break;
02789 case CX_INNER:
02790 s = message ("Inner Context:%q", fileloc_unparse (g_currentloc));
02791 break;
02792 case CX_FUNCTION:
02793 s = message ("Function %q :%q \n\taccess %q\n\tmodifies %q",
02794 uentry_unparse (gc.cont.fcn),
02795 fileloc_unparse (g_currentloc),
02796 typeIdSet_unparse (gc.acct),
02797 sRefSet_unparse (gc.mods));
02798 break;
02799 case CX_MACROFCN:
02800 s = message ("Function Macro %q", uentry_unparse (gc.cont.fcn));
02801 break;
02802 case CX_UNKNOWNMACRO:
02803 s = message ("Forward Specified Macro %q", uentry_unparse (gc.cont.fcn));
02804 break;
02805 case CX_MACROCONST:
02806 s = message ("Constant Macro %q", uentry_unparse (gc.cont.fcn));
02807 break;
02808 case CX_ITERDEF:
02809 s = message ("Iter definition %q", uentry_unparse (gc.cont.fcn));
02810 break;
02811 case CX_ITEREND:
02812 s = message ("Iter end %q", uentry_unparse (gc.cont.fcn));
02813 break;
02814 default:
02815 s = message ("Un-unparseable context: %d", (int) gc.kind);
02816 break;
02817 }
02818
02819 s = message ("%q\naccess: %q", s, context_unparseAccess ());
02820 return (s);
02821 }
|
|
|
Definition at line 1886 of file context.c. 01887 {
01888 return (message ("%q / %q", typeIdSet_unparse (gc.acct),
01889 typeIdSet_unparse (gc.facct)));
01890 }
|
|
|
Definition at line 1893 of file context.c. 01894 {
01895 return (clauseStack_unparse (gc.clauses));
01896 }
|
|
|
Definition at line 175 of file context.c. 00176 {
00177 return (flagMarkerList_unparse (gc.markers));
00178 }
|
|
|
Definition at line 1838 of file context.c. 01839 {
01840 if (!globSet_member (gc.globs_used, el))
01841 {
01842 /*
01843 ** The first time a global is used in a function, we need
01844 ** to clear the derived sRefs, since they were set for the
01845 ** previous function.
01846 */
01847
01848 sRef_clearDerived (el);
01849 gc.globs_used = globSet_insert (gc.globs_used, el);
01850 }
01851 }
|
|
|
Definition at line 3244 of file context.c. Referenced by main(). 03245 {
03246 DPRINTF (("set flag: %s", flagcode_name (f)));
03247
03248 if (f == FLG_NEVERINCLUDE && b)
03249 {
03250 if (gc.flags[FLG_EXPORTHEADER])
03251 {
03252 flagWarning (cstring_makeLiteralTemp
03253 ("setting +neverinclude after +exportheader. "
03254 "Turning off exportheader, since headers are not checked "
03255 "when +neverinclude is used."));
03256
03257 gc.flags[FLG_EXPORTHEADER] = FALSE;
03258 }
03259 }
03260 else
03261 {
03262 if (f == FLG_EXPORTHEADER && b)
03263 {
03264 if (gc.flags[FLG_NEVERINCLUDE])
03265 {
03266 flagWarning (cstring_makeLiteralTemp
03267 ("setting +exportheader after +neverinclude. "
03268 "Not setting exportheader, since headers are not checked "
03269 "when +neverinclude is used."));
03270 gc.flags[FLG_EXPORTHEADER] = FALSE;
03271 return;
03272 }
03273 }
03274 }
03275
03276 if (context_getFlag (FLG_WARNFLAGS) && f != FLG_NOF && f != FLG_OPTF)
03277 {
03278 bool lastsetting = context_getFlag (f);
03279
03280 if (bool_equal (lastsetting, b)
03281 && !flagcode_isSpecialFlag (f)
03282 && !flagcode_isIdemFlag (f)
03283 && !flagcode_hasArgument (f))
03284 {
03285 cstring warn = message ("setting %s%s redundant with current value",
03286 cstring_makeLiteralTemp (b ? "+" : "-"),
03287 flagcode_name (f));
03288 flagWarning (warn);
03289 cstring_free (warn);
03290 }
03291 }
03292
03293 if (flagcode_isLibraryFlag (f))
03294 {
03295 if (gc.library != FLG_ANSILIB
03296 && gc.library != f)
03297 {
03298 cstring warn = message ("selecting library %s after library %s was "
03299 "selected (only one library may be used)",
03300 flagcode_name (f),
03301 flagcode_name (gc.library));
03302 flagWarning (warn);
03303 cstring_free (warn);
03304 }
03305
03306 if (f == FLG_UNIXLIB)
03307 {
03308 if (context_getFlag (FLG_WARNUNIXLIB))
03309 {
03310 flagWarning (cstring_makeLiteralTemp
03311 ("selecting unix library. Unix library is "
03312 "ad hoc addition to POSIX library. Recommend "
03313 "use +posixlib to select POSIX library instead. "
03314 "Use -warnunixlib to suppress this message."));
03315 }
03316 }
03317
03318 gc.library = f;
03319 }
03320
03321 gc.setGlobally[f] = TRUE;
03322 context_setFlag (f, b);
03323 }
|
|
|
Definition at line 540 of file context.c. Referenced by lcllib_isSkipHeader(). 00541 {
00542 return (gc.library != FLG_NOLIB);
00543 }
|
|
|
Definition at line 532 of file context.c. Referenced by lcllib_isSkipHeader(). 00533 {
00534 return (gc.library == FLG_POSIXLIB
00535 || gc.library == FLG_POSIXSTRICTLIB
00536 || gc.library == FLG_UNIXLIB
00537 || gc.library == FLG_UNIXSTRICTLIB);
00538 }
|
1.2.3 written by Dimitri van Heesch,
© 1997-2000