#include "lclintMacros.nf"#include "basic.h"#include "structNames.h"#include "ctbase.i"#include "cttable.i"Go to the source code of this file.
Functions | |
| ctkind | ctkind_fromInt (int i) |
| void | ctype_initTable () |
| void | ctype_destroyMod () |
| void | ctype_loadTable (FILE *f) |
| void | ctype_dumpTable (FILE *f) |
| cstring | ctype_unparseTable () |
| void | ctype_printTable () |
| bool | ctype_isUserBool (ctype ct) |
| ctype | ctype_createUser (typeId u) |
| ctype | ctype_createAbstract (typeId u) |
| int | ctype_count (void) |
| ctype | ctype_realType (ctype c) |
| bool | ctype_isSimple (ctype c) |
| ctype | ctype_forceRealType (ctype c) |
| ctype | ctype_realishType (ctype c) |
| bool | ctype_isUA (ctype c) |
| bool | ctype_isUser (ctype c) |
| bool | ctype_isAbstract (ctype c) |
| bool | ctype_isRealAbstract (ctype c) |
| ctype | ctype_makePointer (ctype c) |
| ctype | ctype_makeFixedArray (ctype c, long size) |
| ctype | ctype_makeArray (ctype c) |
| ctype | ctype_baseArrayPtr (ctype c) |
| ctype | ctype_returnValue (ctype c) |
| uentryList | ctype_argsFunction (ctype c) |
| ctype | ctype_newBase (ctype c, ctype p) |
| bool | ctype_sameAltTypes (ctype c1, ctype c2) |
| int | ctype_compare (ctype c1, ctype c2) |
| ctype | ctype_makeParamsFunction (ctype base, uentryList p) |
| ctype | ctype_makeNFParamsFunction (ctype base, uentryList p) |
| ctype | ctype_makeFunction (ctype base, uentryList p) |
| ctype | ctype_expectFunction (ctype c) |
| ctype | ctype_makeRealFunction (ctype base, uentryList p) |
| bool | ctype_isFunction (ctype c) |
| bool | ctype_isExpFcn (ctype c) |
| bool | ctype_isVoid (ctype c) |
| bool | ctype_isArbitraryIntegral (ctype c) |
| bool | ctype_isUnsignedIntegral (ctype c) |
| bool | ctype_isSignedIntegral (ctype c) |
| bool | ctype_isInt (ctype c) |
| bool | ctype_isRegularInt (ctype c) |
| bool | ctype_isString (ctype c) |
| bool | ctype_isChar (ctype c) |
| bool | ctype_isUnsignedChar (ctype c) |
| bool | ctype_isSignedChar (ctype c) |
| bool | ctype_isManifestBool (ctype c) |
| bool | ctype_isBool (ctype c) |
| bool | ctype_isDirectBool (ctype c) |
| bool | ctype_isReal (ctype c) |
| bool | ctype_isFloat (ctype c) |
| bool | ctype_isDouble (ctype c) |
| bool | ctype_isSigned (ctype c) |
| bool | ctype_isNumeric (ctype c) |
| bool | ctype_isRealNumeric (ctype c) |
| bool | ctype_isRealInt (ctype c) |
| bool | ctype_isRealVoid (ctype c) |
| bool | ctype_isRealBool (ctype c) |
| bool | ctype_isRealPointer (ctype c) |
| bool | ctype_isRealSU (ctype c) |
| bool | ctype_isRealArray (ctype c) |
| bool | ctype_isRealAP (ctype c) |
| bool | ctype_isRealFunction (ctype c) |
| bool | ctype_isDirectInt (ctype c) |
| bool | ctype_isForceRealNumeric (ctype * c) |
| bool | ctype_isForceRealInt (ctype * c) |
| bool | ctype_isForceRealBool (ctype * c) |
| ctype | ctype_makeExplicitConj (ctype c1, ctype c2) |
| ctype | ctype_makeConj (ctype c1, ctype c2) |
| bool | ctype_isConj (ctype c) |
| ctype | ctype_createStruct ( cstring n, uentryList f) |
| uentryList | ctype_getFields (ctype c) |
| ctype | ctype_createUnion ( cstring n, uentryList f) |
| bool | ctype_genMatch (ctype c1, ctype c2, bool force, bool arg, bool def, bool deep) |
| bool | ctype_sameName (ctype c1, ctype c2) |
| bool | ctype_almostEqual (ctype c1, ctype c2) |
| bool | ctype_matchDef (ctype c1, ctype c2) |
| bool | ctype_match (ctype c1, ctype c2) |
| bool | ctype_forceMatch (ctype c1, ctype c2) |
| bool | ctype_matchArg (ctype c1, ctype c2) |
| bool | ctype_isVoidPointer (ctype c) |
| bool | ctype_isPointer (ctype c) |
| bool | ctype_isArray (ctype c) |
| bool | ctype_isIncompleteArray (ctype c) |
| bool | ctype_isFixedArray (ctype c) |
| bool | ctype_isArrayPtr (ctype c) |
| typeId | ctype_typeId (ctype c) |
| cstring | ctype_unparseDeclaration (ctype c, cstring name) |
| cstring | ctype_unparse (ctype c) |
| cstring | ctype_unparseSafe (ctype c) |
| cstring | ctype_unparseDeep (ctype c) |
| ctype | ctype_undump (char **c) |
| cstring | ctype_dump (ctype c) |
| ctype | ctype_getBaseType (ctype c) |
| ctype | ctype_adjustPointers (int np, ctype c) |
| enumNameList | ctype_elist (ctype c) |
| bool | ctype_isFirstVoid (ctype c) |
| ctype | ctype_createEnum ( cstring tag, enumNameList el) |
| bool | ctype_isEnum (ctype c) |
| cstring | ctype_enumTag (ctype c) |
| bool | ctype_isStruct (ctype c) |
| bool | ctype_isUnion (ctype c) |
| ctype | ctype_resolveNumerics (ctype c1, ctype c2) |
| bool | ctype_isStructorUnion (ctype c) |
| ctype | ctype_fixArrayPtr (ctype c) |
| ctype | ctype_createUnnamedStruct ( uentryList f) |
| ctype | ctype_createUnnamedUnion ( uentryList f) |
| ctype | ctype_createForwardStruct (cstring n) |
| ctype | ctype_createForwardUnion (cstring n) |
| ctype | ctype_removePointers (ctype c) |
| bool | ctype_isMutable (ctype t) |
| bool | ctype_isRefCounted (ctype t) |
| bool | ctype_isVisiblySharable (ctype t) |
| ctype | ctype_combine (ctype dominant, ctype modifier) |
| ctype | ctype_resolve (ctype c) |
| ctype | ctype_fromQual (qual q) |
| bool | ctype_isAnyFloat (ctype c) |
| bool | ctype_isUnsigned (ctype c) |
| bool | ctype_isStackAllocated (ctype c) |
| ctype | ctype_widest (ctype c1, ctype c2) |
|
|
Definition at line 80 of file ctype.c. 00081 {
00082 /*@+enumint@*/
00083 if (i < CTK_UNKNOWN || i > CTK_COMPLEX)
00084 {
00085 llcontbug (message ("ctkind_fromInt: out of range: %d", i));
00086 return CTK_INVALID;
00087 }
00088 return (ctkind) i;
00089 /*@=enumint@*/
00090 }
|
|
|
Definition at line 1762 of file ctype.c. Referenced by qtype_adjustPointers(). 01763 {
01764
01765 if (ctype_isFunction (c))
01766 {
01767 c = ctype_makeParamsFunction
01768 (ctype_adjustPointers (np, ctype_returnValue (c)),
01769 uentryList_copy (ctype_argsFunction (c)));
01770 }
01771 else
01772 {
01773 /* fix this should not use getBaseType ??? */
01774 ctype cb = ctype_getBaseType (c);
01775
01776 while (np > 0)
01777 {
01778 cb = ctype_makePointer (cb);
01779 np--;
01780 }
01781 c = ctype_newBase (c, cb);
01782 }
01783
01784 return (c);
01785 }
|
|
|
Definition at line 1419 of file ctype.c. Referenced by uentryList_matchFields(), and uentryList_showFieldDifference(). 01420 {
01421 if (ctype_equal (c1, c2))
01422 {
01423 return TRUE;
01424 }
01425 else
01426 {
01427 return (ctbase_almostEqual (ctype_getCtbase (c1), ctype_getCtbase (c2)));
01428 }
01429 }
|
|
|
Definition at line 382 of file ctype.c. Referenced by uentry_getParams(), and uentry_makeIdFunction(). 00383 {
00384 return (ctbase_argsFunction (ctype_getCtbaseSafe (c)));
00385 }
|
|
|
Definition at line 331 of file ctype.c. Referenced by ctype_removePointers(), exprNode_arrayFetch(), exprNode_preOp(), modListArrowAccess(), sRef_deriveType(), and uentry_makeParam(). 00332 {
00333 ctentry cte = ctype_getCtentry (ctype_realType (c));
00334
00335 if (ctype_isConj (c))
00336 {
00337 if (ctype_isAP (ctype_getConjA (c)))
00338 {
00339 if (ctype_isAP (ctype_getConjB (c)))
00340 {
00341 return (ctype_makeConj (ctype_baseArrayPtr (ctype_getConjA (c)),
00342 ctype_baseArrayPtr (ctype_getConjB (c))));
00343 }
00344 else
00345 {
00346 return (ctype_baseArrayPtr (ctype_getConjA (c)));
00347 }
00348 }
00349 else
00350 {
00351 return (ctype_baseArrayPtr (ctype_getConjB (c)));
00352 }
00353 }
00354 else if (ctype_isInt (c)) /* could be NULL */
00355 {
00356 return ctype_unknown;
00357 }
00358 else
00359 {
00360 ctype clp = ctentry_getBase (cte);
00361
00362 if (ctype_isBroken (clp))
00363 {
00364 llbuglit ("ctype_baseArrayPtr: bogus ctype");
00365 }
00366
00367 return clp;
00368 }
00369 }
|
|
|
Definition at line 2043 of file ctype.c. Referenced by qtype_combine(). 02044 {
02045 DPRINTF (("Combine: %s + %s",
02046 ctype_unparse (dominant),
02047 ctype_unparse (modifier)));
02048
02049 if (ctype_isConj (dominant))
02050 {
02051 ctype res;
02052
02053 if (ctype_isExplicitConj (dominant))
02054 {
02055 res = ctype_makeExplicitConj (ctype_combine (ctype_getConjA (dominant),
02056 modifier),
02057 ctype_getConjB (dominant));
02058 }
02059 else
02060 {
02061 res = ctype_makeConj (ctype_combine (ctype_getConjA (dominant),
02062 modifier),
02063 ctype_getConjB (dominant));
02064 }
02065
02066 return res;
02067 }
02068
02069 if (ctype_isUnknown (modifier))
02070 {
02071 return dominant;
02072 }
02073 else if (ctype_isUnknown (dominant))
02074 {
02075 return modifier;
02076 }
02077 else
02078 {
02079 if (ctype_isEnum (dominant)) dominant = ctype_int;
02080 if (ctype_isEnum (modifier)) modifier = ctype_int;
02081
02082 if (modifier == ctype_uint)
02083 {
02084 if (dominant == ctype_int) return ctype_uint;
02085 if (dominant == ctype_lint) return ctype_ulint;
02086 if (dominant == ctype_sint) return ctype_usint;
02087 if (dominant == ctype_char) return ctype_uchar;
02088 if ((dominant == ctype_uint) || dominant == ctype_uchar)
02089 {
02090 voptgenerror (FLG_DUPLICATEQUALS,
02091 message ("Duplicate unsigned qualifier"),
02092 g_currentloc);
02093
02094 return ctype_uint;
02095 }
02096 else
02097 {
02098 voptgenerror (FLG_DUPLICATEQUALS,
02099 message ("Type qualifier unsigned used with %s",
02100 ctype_unparse (dominant)),
02101 g_currentloc);
02102
02103 return dominant;
02104 }
02105 }
02106 else if (modifier == ctype_llint)
02107 {
02108 if (dominant == ctype_int)
02109 {
02110 return ctype_llint;
02111 }
02112
02113 voptgenerror (FLG_DUPLICATEQUALS,
02114 message ("Duplicate long qualifier on non-int"),
02115 g_currentloc);
02116 }
02117 else if (modifier == ctype_lint)
02118 {
02119 if (dominant == ctype_int) return ctype_lint;
02120 if (dominant == ctype_uint) return ctype_ulint;
02121 if (dominant == ctype_double) return ctype_ldouble;
02122
02123 if (dominant == ctype_lint || dominant == ctype_ulint
02124 || dominant == ctype_sint || dominant == ctype_usint
02125 || dominant == ctype_ldouble)
02126 {
02127 if (dominant == ctype_lint)
02128 {
02129 /* long long not supported by ANSI */
02130 return ctype_llint;
02131 }
02132
02133 if (dominant == ctype_sint || dominant == ctype_usint)
02134 {
02135 if (!context_getFlag (FLG_IGNOREQUALS))
02136 {
02137 llerrorlit (FLG_SYNTAX,
02138 "Contradictory long and short type qualifiers");
02139 }
02140 }
02141 else
02142 {
02143 voptgenerror (FLG_DUPLICATEQUALS,
02144 message ("Duplicate long qualifier"),
02145 g_currentloc);
02146 }
02147
02148 return ctype_lint;
02149 }
02150 }
02151 else if (modifier == ctype_sint)
02152 {
02153 if (dominant == ctype_int) return ctype_sint;
02154 if (dominant == ctype_uint) return ctype_usint;
02155
02156 if (dominant == ctype_sint || dominant == ctype_usint)
02157 {
02158 voptgenerror (FLG_DUPLICATEQUALS,
02159 message ("Duplicate short qualifier"),
02160 g_currentloc);
02161 return ctype_uint;
02162 }
02163 else if (dominant == ctype_lint)
02164 {
02165 if (!context_getFlag (FLG_IGNOREQUALS))
02166 {
02167 llerrorlit (FLG_SYNTAX,
02168 "Contradictory long and short type qualifiers");
02169 }
02170
02171 return dominant;
02172 }
02173 else
02174 {
02175 if (!context_getFlag (FLG_IGNOREQUALS))
02176 {
02177 llerror (FLG_SYNTAX,
02178 message ("Type qualifier short used with %s",
02179 ctype_unparse (dominant)));
02180 }
02181
02182 return dominant;
02183 }
02184 }
02185 else if (modifier == ctype_ulint)
02186 {
02187 if (dominant == ctype_int) return modifier;
02188
02189 if (dominant == ctype_lint || dominant == ctype_ulint)
02190 {
02191 voptgenerror (FLG_DUPLICATEQUALS,
02192 message ("Duplicate long qualifier"),
02193 g_currentloc);
02194
02195 return modifier;
02196 }
02197
02198 if (dominant == ctype_uint || dominant == ctype_usint)
02199 {
02200 voptgenerror (FLG_DUPLICATEQUALS,
02201 message ("Duplicate unsigned qualifier"),
02202 g_currentloc);
02203
02204 return modifier;
02205 }
02206
02207 if (dominant == ctype_sint || dominant == ctype_usint)
02208 {
02209 if (!context_getFlag (FLG_IGNOREQUALS))
02210 {
02211 llerrorlit (FLG_SYNTAX,
02212 "Contradictory long and short type qualifiers");
02213 }
02214
02215 return dominant;
02216 }
02217
02218 if (!context_getFlag (FLG_IGNOREQUALS))
02219 {
02220 llerror (FLG_SYNTAX,
02221 message ("Type qualifiers unsigned long used with %s",
02222 ctype_unparse (dominant)));
02223 }
02224
02225 return dominant;
02226 }
02227 else if (modifier == ctype_usint)
02228 {
02229 if (dominant == ctype_int) return modifier;
02230
02231 if (dominant == ctype_sint || dominant == ctype_usint)
02232 {
02233 voptgenerror (FLG_DUPLICATEQUALS,
02234 message ("Duplicate short qualifier"),
02235 g_currentloc);
02236 return modifier;
02237 }
02238
02239 if (dominant == ctype_uint)
02240 {
02241 voptgenerror (FLG_DUPLICATEQUALS,
02242 message ("Duplicate unsigned qualifier"),
02243 g_currentloc);
02244
02245 return modifier;
02246 }
02247
02248 if (dominant == ctype_lint || dominant == ctype_ulint
02249 || dominant == ctype_llint)
02250 {
02251 if (!context_getFlag (FLG_IGNOREQUALS))
02252 {
02253 llerrorlit (FLG_SYNTAX,
02254 "Contradictory long and short type qualifiers");
02255 }
02256
02257 return dominant;
02258 }
02259
02260 if (!context_getFlag (FLG_IGNOREQUALS))
02261 {
02262 llerror (FLG_SYNTAX,
02263 message ("Type qualifiers unsigned short used with %s",
02264 ctype_unparse (dominant)));
02265 }
02266
02267 return dominant;
02268 }
02269 else
02270 {
02271 ;
02272 }
02273
02274 return dominant;
02275 }
02276 }
|
|
|
Definition at line 460 of file ctype.c. Referenced by ctype_sameAltTypes(), and uentry_compare(). 00461 {
00462 ctentry ce1;
00463 ctentry ce2;
00464
00465 /* Can't get entries for special ctypes (elips marker) */
00466
00467 if (ctype_isElips (c1) || ctype_isElips (c2)
00468 || ctype_isMissingParamsMarker (c1) || ctype_isMissingParamsMarker (c2)) {
00469 return int_compare (c1, c2);
00470 }
00471
00472 ce1 = ctype_getCtentry (c1);
00473 ce2 = ctype_getCtentry (c2);
00474
00475 if (ctentry_isComplex (ce1))
00476 {
00477 if (ctentry_isComplex (ce2))
00478 {
00479 return (ctbase_compare (ctype_getCtbase (c1),
00480 ctype_getCtbase (c2), FALSE));
00481 }
00482 else
00483 {
00484 return 1;
00485 }
00486 }
00487 else if (ctentry_isComplex (ce2))
00488 {
00489 return -1;
00490 }
00491 else
00492 {
00493 return (int_compare (c1, c2));
00494 }
00495 }
|
|
|
Definition at line 162 of file ctype.c. 00163 {
00164 return (cttab.size);
00165 }
|
|
|
Definition at line 154 of file ctype.c. Referenced by uentry_setAbstract(), uentry_setDatatype(), and usymtab_supTypeEntry(). 00155 {
00156 /* requires: ctype_createAbstract (u) is never called more than once for any u. */
00157 /* [ tested by cttable_addFullSafe, not really required ] */
00158 return (cttable_addFullSafe (ctentry_makeNew (CTK_PLAIN, ctbase_createAbstract (u))));
00159 }
|
|
|
Definition at line 1801 of file ctype.c. Referenced by declareEnum(), and declareUnnamedEnum(). 01802 {
01803 return (cttable_addComplex (ctbase_createEnum (tag, el)));
01804 }
|
|
|
Definition at line 1930 of file ctype.c. Referenced by handleStruct(). 01931 {
01932 uentry ue = uentry_makeStructTag (n, ctype_unknown, fileloc_undefined);
01933 ctype ct = usymtab_supForwardTypeEntry (ue);
01934
01935 cstring_free (n);
01936 return (ct);
01937 }
|
|
|
Definition at line 1940 of file ctype.c. Referenced by handleUnion(). 01941 {
01942 uentry ue = uentry_makeUnionTag (n, ctype_unknown, fileloc_undefined);
01943 ctype ct = usymtab_supForwardTypeEntry (ue);
01944
01945 cstring_free (n);
01946 return (ct);
01947 }
|
|
|
<< need to fix resolveConj >> * Definition at line 1345 of file ctype.c. Referenced by ctype_createUnnamedStruct(), and declareStruct(). 01346 {
01347 ctype ct;
01348
01349 ct = cttable_addComplex (ctbase_createStruct (n, f));
01350 return (ct);
01351 }
|
|
|
Definition at line 1360 of file ctype.c. Referenced by ctype_createUnnamedUnion(), and declareUnion(). 01361 {
01362 ctype ret;
01363
01364 ret = cttable_addComplex (ctbase_createUnion (n, f));
01365 return ret;
01366 }
|
|
|
Definition at line 1885 of file ctype.c. Referenced by declareUnnamedStruct(). 01886 {
01887 ctype ret = usymtab_structFieldsType (f);
01888
01889 if (ctype_isDefined (ret))
01890 {
01891 uentryList_free (f);
01892 return ret;
01893 }
01894 else
01895 {
01896 cstring ft = fakeTag ();
01897 ctype ct = ctype_createStruct (cstring_copy (ft), f);
01898 uentry ue = uentry_makeStructTagLoc (ft, ct);
01899
01900 usymtab_supGlobalEntry (ue);
01901
01902 cstring_free (ft);
01903 return (ct);
01904 }
01905 }
|
|
|
Definition at line 1908 of file ctype.c. Referenced by declareUnnamedUnion(). 01909 {
01910 ctype ret = usymtab_unionFieldsType (f);
01911
01912 if (ctype_isDefined (ret))
01913 {
01914 uentryList_free (f);
01915 return ret;
01916 }
01917 else
01918 {
01919 cstring ft = fakeTag ();
01920 ctype ct = ctype_createUnion (cstring_copy (ft), f);
01921 uentry ue = uentry_makeUnionTagLoc (ft, ct);
01922
01923 usymtab_supGlobalEntry (ue);
01924 cstring_free (ft);
01925 return (ct);
01926 }
01927 }
|
|
|
Definition at line 145 of file ctype.c. Referenced by uentry_setDatatype(), and usymtab_supTypeEntry(). 00146 {
00147 /* requires: ctype_createUser (u) is never called more than once for any u. */
00148
00149 ctbase ct = ctbase_createUser (u);
00150 return (cttable_addFullSafe (ctentry_makeNew (CTK_PLAIN, ct)));
00151 }
|
|
|
Definition at line 103 of file ctype.c. Referenced by context_destroyMod(). 00104 {
00105 cttable_reset ();
00106 }
|
|
|
Definition at line 1676 of file ctype.c. 01677 {
01678 DPRINTF (("Ctype dump: %s", ctype_unparse (c)));
01679
01680 if (c < 0)
01681 {
01682 /* Handle invalid types in a kludgey way. */
01683 return (message ("0"));
01684 }
01685
01686 if (ctype_isUA (c))
01687 {
01688 cstring tname = usymtab_getTypeEntryName
01689 (usymtab_convertId (ctype_typeId (c)));
01690
01691 if (cstring_equal (tname, context_getBoolName ()))
01692 {
01693 cstring_free (tname);
01694 return (message ("%d", ctype_bool));
01695 }
01696
01697 cstring_free (tname);
01698 }
01699
01700 DPRINTF (("Returning: %d", c));
01701 return (message ("%d", c));
01702 }
|
|
|
Definition at line 115 of file ctype.c. Referenced by dumpState(). 00116 {
00117 DPRINTF (("Dumping cttable!"));
00118 cttable_dump (f);
00119 }
|
|
|
Definition at line 1789 of file ctype.c. 01790 {
01791 return (ctbase_elist (ctype_getCtbase (c)));
01792 }
|
|
|
Definition at line 1813 of file ctype.c. 01814 {
01815 llassert (ctype_isEnum (c));
01816
01817 return (ctbase_enumTag (ctype_getCtbaseSafe (c)));
01818 }
|
|
|
Definition at line 527 of file ctype.c. 00528 {
00529 /* handle parenthesized declarations */
00530
00531 if (!ctype_isAP (c))
00532 {
00533 c = ctype_makePointer (c);
00534 }
00535
00536 return (cttable_addComplex (ctbase_expectFunction (c)));
00537 }
|
|
|
Definition at line 1867 of file ctype.c. Referenced by exprNode_arrowAccess(). 01868 {
01869 if (ctype_isArray (c))
01870 {
01871 return (ctype_makePointer (ctype_baseArrayPtr (c)));
01872 }
01873 else
01874 return c;
01875 }
|
|
|
Definition at line 1469 of file ctype.c. Referenced by exprNode_assign(), and exprNode_cond(). 01470 {
01471 if (quickMatch (c1, c2))
01472 return TRUE;
01473
01474 if (ctype_isElips (c1))
01475 return (ctype_isElips (c2));
01476
01477 if (ctype_isElips (c2))
01478 return FALSE;
01479
01480 /*@-modobserver@*/
01481 /* The call forceMatch may modify the observer params, but, we don't care. */
01482 return (ctbase_forceMatch (ctype_getCtbase (c1), ctype_getCtbase (c2)));
01483 /*@=modobserver@*/
01484 }
|
|
|
Definition at line 197 of file ctype.c. Referenced by exprNode_arrowAccess(). 00198 {
00199 ctype r = c;
00200
00201 if (ctype_isUA (c))
00202 {
00203 r = uentry_getForceRealType (usymtab_getTypeEntry (ctype_typeId (c)));
00204 }
00205
00206 return r;
00207 }
|
|
|
Definition at line 2284 of file ctype.c. 02285 {
02286 if (qual_isSigned (q)) return ctype_int;
02287 if (qual_isUnsigned (q)) return ctype_uint;
02288 if (qual_isLong (q)) return ctype_lint;
02289 if (qual_isShort (q)) return ctype_sint;
02290
02291 llcontbug (message ("ctype_fromQual: invalid qualifier: %s", qual_unparse (q)));
02292 return ctype_unknown;
02293 }
|
|
|
Definition at line 1387 of file ctype.c. Referenced by uentryList_matchParams(). 01388 {
01389 bool match;
01390
01391 DPRINTF (("Gen match: %s / %s arg: %s", ctype_unparse (c1), ctype_unparse (c2), bool_unparse (arg)));
01392
01393 if (quickMatch (c1, c2))
01394 {
01395 return TRUE;
01396 }
01397
01398 if (ctype_isElips (c1) || ctype_isElips (c2))
01399 {
01400 return FALSE;
01401 }
01402 else
01403 {
01404 match = ctbase_genMatch (ctype_getCtbase (c1), ctype_getCtbase (c2), force, arg, def, deep);
01405 return (match);
01406 }
01407 }
|
|
|
Definition at line 1705 of file ctype.c. Referenced by ctype_adjustPointers(), exprNode_cast(), usymtab_allUsed(), and usymtab_matchForwardStruct(). 01706 {
01707 ctentry cte = ctype_getCtentry (c);
01708
01709 switch (ctentry_getKind (cte))
01710 {
01711 case CTK_UNKNOWN:
01712 llcontbuglit ("ctype_getBaseType: unknown ctype"); break;
01713 case CTK_INVALID:
01714 llcontbuglit ("ctype_getBaseType: invalid ctype"); break;
01715 case CTK_PLAIN:
01716 return c;
01717 case CTK_PTR:
01718 case CTK_ARRAY:
01719 return (ctype_getBaseType (ctype_baseArrayPtr (c)));
01720 case CTK_COMPLEX:
01721 {
01722 ctbase ctb = cte->ctbase;
01723
01724 if (ctbase_isDefined (ctb))
01725 {
01726 switch (ctb->type)
01727 {
01728 case CT_UNKNOWN:
01729 case CT_PRIM:
01730 case CT_USER:
01731 case CT_ENUM:
01732 case CT_ENUMLIST:
01733 case CT_BOOL:
01734 case CT_ABST:
01735 case CT_FCN:
01736 case CT_STRUCT:
01737 case CT_UNION:
01738 case CT_EXPFCN:
01739 return c;
01740 case CT_PTR:
01741 case CT_ARRAY:
01742 return (ctype_getBaseType (ctb->contents.base));
01743 case CT_FIXEDARRAY:
01744 return (ctype_getBaseType (ctb->contents.farray->base));
01745 case CT_CONJ: /* base type of A conj branch? */
01746 return (ctype_getBaseType (ctb->contents.conj->a));
01747 }
01748 }
01749 else
01750 {
01751 return c;
01752 }
01753 }
01754 default:
01755 llbuglit ("ctype_newBase: bad case");
01756 }
01757 llcontbuglit ("ctype_getBaseType: unreachable code");
01758 return ((ctype)NULL);
01759 }
|
|
|
Definition at line 1354 of file ctype.c. Referenced by exprNode_offsetof(), fixUnnamedDecl(), and usymtab_allUsed(). 01355 {
01356 return (ctbase_getuentryList (ctype_getCtbaseSafe (c)));
01357 }
|
|
|
Definition at line 97 of file ctype.c. Referenced by loadState(), and main(). 00098 {
00099 cttable_init ();
00100 }
|
|
|
Definition at line 242 of file ctype.c. Referenced by ctype_isRealAbstract(), exprNode_cast(), modListArrayFetch(), modListArrowAccess(), modListFieldAccess(), modListPointer(), sRef_perhapsNull(), sRef_possiblyNull(), sRef_setStateFromType(), uentry_checkParams(), uentry_reflectQualifiers(), uentry_returnedRef(), and uentry_setStatic(). 00243 {
00244 return ((ctype_isPlain (c) && ctbase_isAbstract (ctype_getCtbaseSafe (c))) ||
00245 (ctype_isConj (c) &&
00246 (ctype_isAbstract (ctype_getConjA (c))
00247 || ctype_isAbstract (ctype_getConjB (c)))));
00248 }
|
|
|
Definition at line 2296 of file ctype.c. Referenced by exprNode_matchLiteral(). 02297 {
02298 return (cprim_isAnyReal (ctype_toCprim (c)));
02299 }
|
|
|
Definition at line 577 of file ctype.c. 00578 {
00579 ctype cr = ctype_realType (c);
00580
00581 return (cr == ctype_anyintegral || cr == ctype_unsignedintegral
00582 || cr == ctype_signedintegral);
00583 }
|
|
|
Definition at line 1563 of file ctype.c. Referenced by ctype_fixArrayPtr(), ctype_isArrayPtr(), ctype_isIncompleteArray(), ctype_isRealArray(), ctype_isSimple(), ctype_isStackAllocated(), sRef_deriveType(), uentry_checkParams(), uentry_makeParam(), uentry_reflectQualifiers(), uentry_setStatic(), and usymtab_enterFunctionScope(). 01564 {
01565 if (ctype_isElips (c)) return FALSE;
01566
01567 if (ctype_isComplex (c))
01568 return (ctbase_isEitherArray (ctype_getCtbaseSafe (c)));
01569 else
01570 return (ctentry_isArray (ctype_getCtentry (c)));
01571 }
|
|
|
Definition at line 1586 of file ctype.c. Referenced by ctype_removePointers(), exprNode_arrayFetch(), exprNode_cast(), exprNode_makeInitialization(), exprNode_matchLiteral(), sRefSet_addIndirection(), sRefSet_fetchKnown(), sRefSet_fetchUnknown(), and uentry_makeIdFunction(). 01587 {
01588 return ((ctype_isArray (c)) || (ctype_isPointer (c)));
01589 }
|
|
|
Definition at line 678 of file ctype.c. Referenced by ctype_isRealBool(). 00679 {
00680 /*
00681 ** Changed the meaning of ctype_isBool - evs 2000-07-24
00682 ** The old meaning was very convoluted!
00683 **
00684 ** c is a bool if:
00685 ** its a manifest bool
00686 ** +boolint and ctype_isInt (c)
00687 */
00688
00689 if (ctype_isManifestBool (c)) {
00690 return TRUE;
00691 } else if (context_msgBoolInt ()) {
00692 return ctype_isInt (c);
00693 } else {
00694 return FALSE;
00695 }
00696
00697 # if 0
00698 if (context_getFlag (FLG_ABSTRACTBOOL))
00699 {
00700 if (typeId_isInvalid (boolType))
00701 {
00702 boolType = usymtab_getTypeId (context_getBoolName ());
00703 }
00704
00705 if (context_hasAccess (boolType))
00706 {
00707 return (((c == CTX_UNKNOWN) || (c == CTX_BOOL)
00708 || (context_msgBoolInt ()
00709 && (c == CTX_INT
00710 || (c == CTX_CHAR && context_msgCharInt ()))))
00711 || ctype_isInt (c));
00712 }
00713 }
00714
00715 return ((c == CTX_UNKNOWN) || (c == CTX_BOOL)
00716 || (context_msgBoolInt ()
00717 && (c == CTX_INT || (c == CTX_CHAR && context_msgCharInt ()))));
00718 # endif
00719 }
|
|
|
Definition at line 633 of file ctype.c. Referenced by ctype_isString(), exprNode_arrayFetch(), exprNode_matchLiteral(), processNamedDecl(), and uentry_makeIdFunction(). 00634 {
00635 return ((c == ctype_unknown) || (cprim_isAnyChar (ctype_toCprim (c)))
00636 || (context_getFlag (FLG_CHARINT) && ctype_isInt (c)));
00637 }
|
|
|
Definition at line 1311 of file ctype.c. Referenced by ctype_baseArrayPtr(), ctype_combine(), ctype_isAbstract(), ctype_isFirstVoid(), ctype_isRealAP(), ctype_isRealAbstract(), ctype_isRealArray(), ctype_isRealBool(), ctype_isRealFunction(), ctype_isRealInt(), ctype_isRealNumeric(), ctype_isRealPointer(), ctype_isRealSU(), ctype_isRealVoid(), ctype_isStackAllocated(), ctype_isUnsigned(), ctype_isVisiblySharable(), ctype_isVoidPointer(), and ctype_sameAltTypes(). 01312 {
01313 return (ctype_isComplex (c) && ctbase_isConj (ctype_getCtbase (c)));
01314 }
|
|
|
Definition at line 722 of file ctype.c. Referenced by ctype_isManifestBool(), and exprNode_matchLiteral(). 00723 {
00724 return (c == CTX_BOOL);
00725 }
|
|
|
Definition at line 875 of file ctype.c. Referenced by exprNode_checkStatement(). 00876 {
00877 return (c == CTX_INT || c == CTX_UINT || c == CTX_SINT || c == CTX_ULINT || c == CTX_USINT);
00878 }
|
|
|
Definition at line 740 of file ctype.c. 00741 {
00742 return (c == ctype_double || c == ctype_ldouble);
00743 }
|
|
|
Definition at line 1807 of file ctype.c. Referenced by ctype_combine(), ctype_isInt(), ctype_isNumeric(), ctype_isRealInt(), ctype_isRegularInt(), ctype_resolveNumerics(), exprNode_arrayFetch(), processNamedDecl(), and usymtab_enumEnumNameListType(). 01808 {
01809 return (ctype_isComplex (c) && ctbase_isEnum (ctype_getCtbase (c)));
01810 }
|
|
|
Definition at line 565 of file ctype.c. 00566 {
00567 return (ctbase_isExpFcn (ctype_getCtbase (c)));
00568 }
|
|
|
Definition at line 1795 of file ctype.c. Referenced by exprChecks_checkNullReturn(), and exprNode_checkFunctionBody(). 01796 {
01797 return (c == CTX_VOID || (ctype_isConj (c) && ctype_isFirstVoid (ctype_getConjA (c))));
01798 }
|
|
|
Definition at line 1578 of file ctype.c. Referenced by ctype_isIncompleteArray(), uentry_checkParams(), and uentry_makeParam(). 01579 {
01580 if (ctype_isElips (c)) return FALSE;
01581
01582 return (ctbase_isFixedArray (ctype_getCtbaseSafe (c)));
01583 }
|
|
|
Definition at line 734 of file ctype.c. 00735 {
00736 return (c == ctype_float);
00737 }
|
|
|
Definition at line 933 of file ctype.c. 00934 {
00935 return (ctype_isForcePred (c, ctype_isRealBool));
00936 }
|
|
|
Definition at line 927 of file ctype.c. Referenced by exprNode_arrayFetch(), and exprNode_preOp(). 00928 {
00929 return (ctype_isForcePred (c, ctype_isRealInt));
00930 }
|
|
|
Definition at line 921 of file ctype.c. Referenced by exprNode_postOp(), and exprNode_preOp(). 00922 {
00923 return (ctype_isForcePred (c, ctype_isRealNumeric));
00924 }
|
|
|
Definition at line 559 of file ctype.c. Referenced by context_checkExport(), context_getRetType(), ctype_adjustPointers(), ctype_isRealFunction(), ctype_isSimple(), ctype_makeConj(), ctype_makeExplicitConj(), declareStaticFunction(), doDeclareConstant(), doDeclareVar(), exprChecks_checkExport(), exprChecks_checkNullReturn(), exprNode_arrayFetch(), exprNode_cast(), exprNode_checkFunctionBody(), exprNode_checkMacroBody(), exprNode_checkReturn(), exprNode_preOp(), idDecl_fixParamBase(), processNamedDecl(), uentry_getParams(), uentry_isForward(), uentry_isRealFunction(), uentry_makeIdVariable(), uentry_makeVarFunction(), uentry_reflectQualifiers(), uentry_resetParams(), uentry_returnedRef(), uentry_sameKind(), uentry_setGlobals(), uentry_setMessageLike(), uentry_setModifies(), uentry_setPrintfLike(), uentry_setScanfLike(), uentry_setStatic(), usymtab_allUsed(), and usymtab_checkFinalScope(). 00560 {
00561 return (ctbase_isFunction (ctype_getCtbase (c)));
00562 }
|
|
|
Definition at line 1573 of file ctype.c. Referenced by uentry_makeParam(). 01574 {
01575 return (ctype_isArray (c) && !ctype_isFixedArray (c));
01576 }
|
|
|
Definition at line 602 of file ctype.c. Referenced by ctype_baseArrayPtr(), ctype_isBool(), ctype_isChar(), ctype_isNumeric(), ctype_isRealInt(), exprNode_preOp(), processNamedDecl(), and uentry_makeIdFunction(). 00603 {
00604 cprim cp = ctype_toCprim (c);
00605
00606 return (c == ctype_unknown || cprim_isAnyInt (cp)
00607 || (cprim_isAnyChar (cp) && context_msgCharInt ())
00608 || (c == ctype_bool && context_msgBoolInt ())
00609 || (ctype_isEnum (c) && context_msgEnumInt ()));
00610 }
|
|
|
Definition at line 656 of file ctype.c. Referenced by ctype_isBool(), ctype_makeConj(), ctype_realType(), ctype_realishType(), exprNode_checkStatement(), uentry_getForceRealType(), and uentry_getRealType(). 00657 {
00658 /*
00659 ** Changed the meaning of ctype_isBool - evs 2000-07-24
00660 ** The old meaning was very convoluted!
00661 **
00662 ** c is a bool if:
00663 ** c == CTX_BOOL - its a direct bool
00664 ** c is a user/abstract type matching the bool name
00665 ** (should never occur?)
00666 */
00667
00668 if (ctype_isDirectBool (c)) {
00669 return TRUE;
00670 } else if (ctype_isUA (c)) {
00671 return ctype_isUserBool (c);
00672 } else {
00673 return FALSE;
00674 }
00675 }
|
|
|
Definition at line 1964 of file ctype.c. Referenced by ctype_isVisiblySharable(), and usymtab_checkFinalScope(). 01965 {
01966 if (ctype_isUA (t))
01967 {
01968 return (uentry_isMutableDatatype
01969 (usymtab_getTypeEntry (ctype_typeId (t))));
01970 }
01971 else
01972 {
01973 return (ctype_isPointer (ctype_realType (t)));
01974 }
01975 }
|
|
|
Definition at line 752 of file ctype.c. Referenced by ctype_isRealNumeric(). 00753 {
00754 return (ctype_isInt (c) || ctype_isReal (c) || ctype_isEnum (c));
00755 }
|
|
|
Definition at line 1537 of file ctype.c. Referenced by ctype_isArrayPtr(), ctype_isMutable(), ctype_isRealPointer(), ctype_isSimple(), ctype_isString(), idDecl_fixParamBase(), sRef_deriveType(), and usymtab_matchForwardStruct(). 01538 {
01539 if (ctype_isElips (c)) return FALSE;
01540
01541 if (ctype_isComplex (c))
01542 {
01543 ctbase ctb = ctype_getCtbaseSafe (c);
01544 bool res = ctbase_isPointer (ctb);
01545
01546 return res;
01547 }
01548 else
01549 {
01550 bool res = ctentry_isPointer (ctype_getCtentry (c));
01551
01552 return res;
01553 }
01554 }
|
|
|
Definition at line 728 of file ctype.c. Referenced by ctype_isNumeric(). 00729 {
00730 return (cprim_isAnyReal (ctype_toCprim (c)));
00731 }
|
|
|
Definition at line 857 of file ctype.c. Referenced by checkPassTransfer(), exprNode_arrayFetch(), exprNode_cast(), exprNode_postOp(), and exprNode_preOp(). 00858 {
00859 if (ctype_isConj (c))
00860 return (ctype_isRealAP (ctype_getConjA (c)) ||
00861 ctype_isRealAP (ctype_getConjB (c)));
00862 return (ctype_isAP (ctype_realType (c)));
00863 }
|
|
|
Definition at line 251 of file ctype.c. Referenced by exprNode_arrowAccess(), exprNode_cast(), exprNode_fieldAccess(), exprNode_postOp(), and exprNode_preOp(). 00252 {
00253 return (ctype_isAbstract (ctype_realType (c)) ||
00254 (ctype_isConj (c) &&
00255 (ctype_isRealAbstract (ctype_getConjA (c)) ||
00256 ctype_isRealAbstract (ctype_getConjB (c)))));
00257 }
|
|
|
Definition at line 848 of file ctype.c. Referenced by exprNode_arrayFetch(), exprNode_sizeofExpr(), and usymtab_enterFunctionScope(). 00849 {
00850 if (ctype_isConj (c))
00851 return (ctype_isRealArray (ctype_getConjA (c)) ||
00852 ctype_isRealArray (ctype_getConjB (c)));
00853 return (ctype_isArray (ctype_realType (c)));
00854 }
|
|
|
Definition at line 810 of file ctype.c. Referenced by exprNode_checkPred(), and exprNode_preOp(). 00811 {
00812 if (ctype_isPlain (c))
00813 {
00814 return (ctype_isBool (ctype_realishType (c)));
00815 }
00816 else if (ctype_isConj (c))
00817 {
00818 return (ctype_isRealBool (ctype_getConjA (c)) ||
00819 ctype_isRealBool (ctype_getConjB (c)));
00820 }
00821 else
00822 {
00823 return FALSE;
00824 }
00825 }
|
|
|
Definition at line 866 of file ctype.c. Referenced by exprNode_functionCall(). 00867 {
00868 if (ctype_isConj (c))
00869 return (ctype_isRealFunction (ctype_getConjA (c)) ||
00870 ctype_isRealFunction (ctype_getConjB (c)));
00871 return (ctype_isFunction (ctype_realType (c)));
00872 }
|
|
|
Definition at line 777 of file ctype.c. Referenced by exprNode_checkPred(), exprNode_matchLiteral(), and uentry_makeEnumInitializedConstant(). 00778 {
00779 if (ctype_isPlain (c))
00780 return (ctype_isInt (ctype_realType (c)));
00781 else if (ctype_isConj (c))
00782 return (ctype_isRealInt (ctype_getConjA (c)) ||
00783 ctype_isRealInt (ctype_getConjB (c)));
00784 else
00785 {
00786 if (ctype_isEnum (c) && context_msgEnumInt ()) return TRUE;
00787 return FALSE;
00788 }
00789 }
|
|
|
Definition at line 765 of file ctype.c. Referenced by exprNode_arrayFetch(). 00766 {
00767 if (ctype_isPlain (c))
00768 return (ctype_isNumeric (ctype_realType (c)));
00769 if (ctype_isConj (c))
00770 return (ctype_isRealNumeric (ctype_getConjA (c)) ||
00771 ctype_isRealNumeric (ctype_getConjB (c)));
00772 else
00773 return FALSE;
00774 }
|
|
|
Definition at line 828 of file ctype.c. Referenced by ctype_isVoidPointer(), exprNode_arrowAccess(), exprNode_checkMacroBody(), exprNode_checkPred(), exprNode_preOp(), exprNode_produceGuards(), modListArrowAccess(), sRef_buildArrayFetch(), sRef_buildArrayFetchKnown(), and uentry_setStatic(). 00829 {
00830 if (ctype_isConj (c))
00831 return (ctype_isRealPointer (ctype_getConjA (c)) ||
00832 ctype_isRealPointer (ctype_getConjB (c)));
00833 return (ctype_isPointer (ctype_realType (c)));
00834 }
|
|
|
Definition at line 837 of file ctype.c. Referenced by checkAssignTransfer(), checkReturnTransfer(), exprNode_cast(), exprNode_offsetof(), usymtab_checkFinalScope(), and usymtab_enterFunctionScope(). 00838 {
00839 if (ctype_isConj (c))
00840 {
00841 return (ctype_isRealSU (ctype_getConjA (c)) ||
00842 ctype_isRealSU (ctype_getConjB (c)));
00843 }
00844 return (ctype_isStructorUnion (ctype_realType (c)));
00845 }
|
|
|
Definition at line 792 of file ctype.c. Referenced by exprNode_checkStatement(). 00793 {
00794 if (ctype_isPlain (c))
00795 {
00796 return (ctype_isVoid (ctype_realType (c)));
00797 }
00798 else if (ctype_isConj (c))
00799 {
00800 return (ctype_isRealVoid (ctype_getConjA (c)) ||
00801 ctype_isRealVoid (ctype_getConjB (c)));
00802 }
00803 else
00804 {
00805 return FALSE;
00806 }
00807 }
|
|
|
Definition at line 1977 of file ctype.c. 01978 {
01979 if (ctype_isUA (t))
01980 {
01981 return (uentry_isRefCountedDatatype
01982 (usymtab_getTypeEntry (ctype_typeId (t))));
01983 }
01984
01985 return FALSE;
01986 }
|
|
|
Definition at line 613 of file ctype.c. Referenced by exprNode_matchLiteral(). 00614 {
00615 cprim cp = ctype_toCprim (c);
00616
00617 return (c == ctype_unknown
00618 || cprim_closeEnough (cprim_int, cp)
00619 || (cprim_isAnyChar (cp) && context_msgCharInt ())
00620 || (c == ctype_bool && context_msgBoolInt ())
00621 || (ctype_isEnum (c) && context_msgEnumInt ()));
00622 }
|
|
|
Definition at line 746 of file ctype.c. 00747 {
00748 return (!ctype_isUnsigned (c));
00749 }
|
|
|
Definition at line 646 of file ctype.c. 00647 {
00648 return ((c == ctype_unknown) || (cprim_isSignedChar (ctype_toCprim (c))));
00649 }
|
|
|
Definition at line 594 of file ctype.c. 00595 {
00596 ctype cr = ctype_realType (c);
00597
00598 return (cr == ctype_signedintegral);
00599 }
|
|
|
Definition at line 189 of file ctype.c. 00190 {
00191 return (!(ctype_isPointer (c)
00192 || ctype_isArray (c)
00193 || ctype_isFunction (c)));
00194 }
|
|
|
Definition at line 2334 of file ctype.c. Referenced by sRef_isStackAllocated(). 02335 {
02336 ctype ct = ctype_realType (c);
02337
02338 if (ctype_isConj (ct))
02339 return (ctype_isStackAllocated (ctype_getConjA (ct)) ||
02340 ctype_isStackAllocated (ctype_getConjB (ct)));
02341
02342 return (ctype_isArray (c) || ctype_isSU (c));
02343 }
|
|
|
Definition at line 625 of file ctype.c. 00626 {
00627 return (c == ctype_string
00628 || (ctype_isPointer (c)
00629 && ctype_isChar (ctype_baseArrayPtr (c))));
00630 }
|
|
|
Definition at line 1821 of file ctype.c. Referenced by ctype_isStructorUnion(), fixUnnamedDecl(), sRefSet_accessField(), uentry_reflectQualifiers(), and usymtab_allUsed(). 01822 {
01823 return (ctype_isComplex (c) && ctbase_isStruct (ctype_getCtbaseSafe (c)));
01824 }
|
|
|
Definition at line 1861 of file ctype.c. Referenced by ctype_isRealSU(), exprNode_arrowAccess(), exprNode_fieldAccess(), modListArrowAccess(), modListFieldAccess(), and sRef_deriveType(). 01862 {
01863 return (ctype_isStruct (c) || ctype_isUnion (c));
01864 }
|
|
|
Definition at line 230 of file ctype.c. Referenced by ctype_dump(), ctype_forceRealType(), ctype_isManifestBool(), ctype_isMutable(), ctype_isRefCounted(), ctype_isUserBool(), ctype_isVisiblySharable(), ctype_realType(), ctype_realishType(), exprNode_checkMacroBody(), exprNode_vaArg(), sRef_makeConst(), sRef_makeType(), uentryList_fixMissingNames(), uentry_getForceRealType(), uentry_getRealType(), uentry_makeDatatypeAux(), and usymtab_matchForwardStruct(). 00231 {
00232 return (ctbase_isUA (ctype_getCtbase (c)));
00233 }
|
|
|
Definition at line 1827 of file ctype.c. Referenced by ctype_isStructorUnion(), fixUnnamedDecl(), sRefSet_accessField(), and sRef_isUnionField(). 01828 {
01829 return (ctype_isComplex (c) && ctbase_isUnion (ctype_getCtbaseSafe (c)));
01830 }
|
|
|
Definition at line 2302 of file ctype.c. Referenced by ctype_isSigned(), and exprNode_matchLiteral(). 02303 {
02304 if (ctype_isConj (c))
02305 return (ctype_isUnsigned (ctype_getConjA (c)) ||
02306 ctype_isUnsigned (ctype_getConjB (c)));
02307
02308 return (c == ctype_uint || c == ctype_uchar
02309 || c == ctype_usint || c == ctype_ulint
02310 || c == ctype_unsignedintegral);
02311 }
|
|
|
Definition at line 640 of file ctype.c. 00641 {
00642 return ((c == ctype_unknown) || (cprim_isUnsignedChar (ctype_toCprim (c))));
00643 }
|
|
|
Definition at line 586 of file ctype.c. 00587 {
00588 ctype cr = ctype_realType (c);
00589
00590 return (cr == ctype_unsignedintegral);
00591 }
|
|
|
Definition at line 236 of file ctype.c. Referenced by sRef_perhapsNull(), sRef_possiblyNull(), sRef_setStateFromType(), and uentry_returnedRef(). 00237 {
00238 return (ctbase_isUser (ctype_getCtbase (c)));
00239 }
|
|
|
Definition at line 134 of file ctype.c. Referenced by ctype_isManifestBool(), and uentry_getAbstractType(). 00135 {
00136 if (ctype_isUA (ct))
00137 {
00138 return (usymtab_isBoolType (ctype_typeId (ct)));
00139 }
00140
00141 return (FALSE);
00142 }
|
|
|
Definition at line 1988 of file ctype.c. Referenced by exprNode_cast(), specialClauses_checkAll(), and uentry_reflectQualifiers(). 01989 {
01990 if (ctype_isUnknown (t)) return TRUE;
01991
01992 if (ctype_isConj (t))
01993 {
01994 return (ctype_isVisiblySharable (ctype_getConjA (t))
01995 || ctype_isVisiblySharable (ctype_getConjB (t)));
01996 }
01997
01998 if (ctype_isMutable (t))
01999 {
02000 if (ctype_isUA (t))
02001 {
02002 ctype rt = ctype_realType (t);
02003
02004 if (rt == t)
02005 {
02006 return TRUE;
02007 }
02008 else
02009 {
02010 return ctype_isVisiblySharable (rt);
02011 }
02012 }
02013 else
02014 {
02015 return TRUE;
02016 }
02017 }
02018
02019 return FALSE;
02020 }
|
|
|
Definition at line 571 of file ctype.c. Referenced by ctype_isRealVoid(), ctype_isVoidPointer(), exprNode_cast(), exprNode_checkMacroBody(), uentryList_isVoid(), and uentryList_size(). 00572 {
00573 return (c == CTX_VOID);
00574 }
|
|
|
Definition at line 1511 of file ctype.c. Referenced by checkPassTransfer(), and exprNode_cast(). 01512 {
01513 if (ctype_isComplex (c))
01514 {
01515 return ctbase_isVoidPointer (ctype_getCtbaseSafe (c));
01516 }
01517 if (ctype_isConj (c))
01518 {
01519 return (ctype_isVoidPointer (ctype_getConjA (c)) ||
01520 ctype_isVoidPointer (ctype_getConjB (c)));
01521 }
01522 else
01523 {
01524 return (c == ctype_voidPointer
01525 || (ctype_isRealPointer (c)
01526 && ctype_isVoid (ctype_baseArrayPtr (c))));
01527 }
01528 }
|
|
|
Definition at line 109 of file ctype.c. Referenced by BUFLEN(). 00110 {
00111 cttable_load (f);
00112 }
|
|
|
Definition at line 311 of file ctype.c. 00312 {
00313 ctentry cte = ctype_getCtentry (c);
00314 ctype clp = ctentry_getArray (cte);
00315
00316 if /*@+enumint@*/ (clp == CTK_DNE) /*@=enumint@*/
00317 {
00318 ctype cnew = cttable_addDerived (CTK_ARRAY, ctbase_makeArray (c), c);
00319 ctentry_setArray (cte, cnew);
00320 return (cnew);
00321 }
00322 else
00323 return clp;
00324 }
|
|
|
Definition at line 1114 of file ctype.c. Referenced by context_typeofZero(), ctype_baseArrayPtr(), ctype_combine(), exprNode_charLiteral(), qtype_mergeAlt(), qtype_mergeImplicitAlt(), sRef_deriveType(), and sRef_makeConj(). 01115 {
01116 /* no: can have unsigned long @alt long@: llassert (c1 != c2); */
01117
01118 DPRINTF (("Make conj: %s / %s", ctype_unparse (c1), ctype_unparse (c2)));
01119
01120 if (ctype_isFunction (c1) && !ctype_isFunction (c2))
01121 {
01122 ctype ret = ctype_makeConj (ctype_returnValue (c1), c2);
01123 return ctype_makeFunction (ret, uentryList_copy (ctype_getParams (c1)));
01124 }
01125 else if (ctype_isFunction (c2) && !ctype_isFunction (c1))
01126 {
01127 ctype ret = ctype_makeConj (c1, ctype_returnValue (c2));
01128 return ctype_makeFunction (ret, uentryList_copy (ctype_getParams (c2)));
01129 }
01130 else
01131 {
01132 if (ctype_isManifestBool (c1))
01133 {
01134 c1 = ctype_bool;
01135 }
01136
01137 if (ctype_isManifestBool (c2))
01138 {
01139 c2 = ctype_bool;
01140 }
01141
01142 if (ctbase_isVoidPointer (ctype_getCtbaseSafe (c1)))
01143 {
01144 c1 = ctype_voidPointer;
01145 }
01146
01147 if (ctbase_isVoidPointer (ctype_getCtbaseSafe (c2)))
01148 {
01149 c2 = ctype_voidPointer;
01150 }
01151
01152 /*
01153 ** Ouch, can't do this. unsigned, etc. modifiers might
01154 ** apply to wrong type!
01155 **
01156 ** if (c2 == ctype_int && c1 != ctype_int)
01157 ** {
01158 ** ctype tmp;
01159 **
01160 ** tmp = c1;
01161 ** c1 = c2;
01162 ** c2 = tmp;
01163 ** }
01164 **
01165 */
01166
01167 if (c1 == ctype_int)
01168 {
01169 if (c2 == ctype_char)
01170 {
01171 if (ic == ctype_unknown)
01172 {
01173 ic = cttable_addComplex (ctbase_makeConj (ctype_int, ctype_char, FALSE));
01174 }
01175
01176 return ic;
01177 }
01178 else if (c2 == ctype_bool)
01179 {
01180 if (ib == ctype_unknown)
01181 {
01182 ib = cttable_addComplex
01183 (ctbase_makeConj (ctype_int, ctype_bool, FALSE));
01184 }
01185
01186 return ib;
01187 }
01188 else if (c2 == ctype_float)
01189 {
01190 if (ifl == ctype_unknown)
01191 {
01192 ifl = cttable_addComplex (ctbase_makeConj (ctype_int, ctype_float, FALSE));
01193 }
01194
01195 return ifl;
01196 }
01197 else
01198 {
01199 if (c2 == ctype_voidPointer)
01200 {
01201 if (iv == ctype_unknown)
01202 {
01203 iv = cttable_addComplex
01204 (ctbase_makeConj (ctype_int,
01205 ctype_voidPointer,
01206 FALSE));
01207 }
01208
01209 return iv;
01210 }
01211 }
01212 }
01213 else if (c1 == ib && ib != ctype_unknown)
01214 {
01215 if (c2 == ctype_float)
01216 {
01217 if (ibf == ctype_unknown)
01218 {
01219 ibf = cttable_addComplex (ctbase_makeConj (ib, ctype_float, FALSE));
01220 }
01221
01222 return ibf;
01223 }
01224 else if (c2 == ctype_char)
01225 {
01226 if (ibc == ctype_unknown)
01227 {
01228 ibc = cttable_addComplex (ctbase_makeConj (ib, ctype_char, FALSE));
01229 }
01230
01231 return ibc;
01232 }
01233 else
01234 {
01235 ;
01236 }
01237 }
01238 else if (c1 == iv)
01239 {
01240 if (c2 == ctype_bool)
01241 {
01242 if (ivb == ctype_unknown)
01243 {
01244 ivb = cttable_addComplex (ctbase_makeConj (c1, c2, FALSE));
01245 }
01246
01247 return ivb;
01248 }
01249 else if (c2 == ctype_float)
01250 {
01251 if (ivf == ctype_unknown)
01252 {
01253 ivf = cttable_addComplex (ctbase_makeConj (c1, c2, FALSE));
01254 }
01255
01256 return ivf;
01257 }
01258 else
01259 {
01260 ;
01261 }
01262 }
01263 else if (c1 == ivf)
01264 {
01265 if (c2 == ctype_bool)
01266 {
01267 if (ivbf == ctype_unknown)
01268 {
01269 ivbf = cttable_addComplex (ctbase_makeConj (c1, c2, FALSE));
01270 }
01271
01272 return ivbf;
01273 }
01274 }
01275 else if (c1 == ivb)
01276 {
01277 if (c2 == ctype_float)
01278 {
01279 if (ivbf == ctype_unknown)
01280 {
01281 ivbf = cttable_addComplex (ctbase_makeConj (c1, c2, FALSE));
01282 }
01283
01284 return ivbf;
01285 }
01286 }
01287 else if (c1 == ctype_char)
01288 {
01289 if (c2 == ctype_uchar)
01290 {
01291 if (cuc == ctype_unknown)
01292 {
01293 cuc = cttable_addComplex (ctbase_makeConj (c1, c2, FALSE));
01294 }
01295
01296 return cuc;
01297 }
01298 }
01299 else
01300 {
01301 ;
01302 }
01303
01304
01305 return (cttable_addComplex (ctbase_makeConj (c1, c2, FALSE)));
01306 }
01307 }
|
|
|
Definition at line 969 of file ctype.c. Referenced by ctype_combine(), and qtype_mergeAlt(). 00970 {
00971 if (ctype_isFunction (c1) && !ctype_isFunction (c2))
00972 {
00973 ctype ret = ctype_makeExplicitConj (ctype_returnValue (c1), c2);
00974
00975 return ctype_makeFunction (ret, uentryList_copy (ctype_getParams (c1)));
00976 }
00977 else if (ctype_isFunction (c2) && !ctype_isFunction (c1))
00978 {
00979 ctype ret = ctype_makeExplicitConj (c1, ctype_returnValue (c2));
00980
00981 return ctype_makeFunction (ret, uentryList_copy (ctype_getParams (c2)));
00982 }
00983 else
00984 {
00985 return (cttable_addComplex (ctbase_makeConj (c1, c2, TRUE)));
00986 }
00987 }
|
|
|
Definition at line 305 of file ctype.c. 00306 {
00307 return (cttable_addDerived (CTK_ARRAY, ctbase_makeFixedArray (c, size), c));
00308 }
|
|
|
Definition at line 520 of file ctype.c. Referenced by ctype_makeConj(), ctype_makeExplicitConj(), ctype_makeParamsFunction(), declareStaticFunction(), and doneParams(). 00521 {
00522 ctype ret;
00523 ret = ctbase_makeFunction (base, p);
00524 return (ret);
00525 }
|
|
|
Definition at line 513 of file ctype.c. Referenced by uentry_resetParams(). 00514 {
00515 uentryList_fixImpParams (p);
00516 return (ctbase_makeNFFunction (base, p));
00517 }
|
|
|
Definition at line 506 of file ctype.c. Referenced by checkDoneParams(). 00507 {
00508 uentryList_fixImpParams (p);
00509 return (ctype_makeFunction (base, p));
00510 }
|
|
|
Definition at line 277 of file ctype.c. Referenced by ctype_adjustPointers(), ctype_expectFunction(), ctype_fixArrayPtr(), exprNode_preOp(), sRef_deriveType(), and sRef_makeAddress(). 00278 {
00279 if (c == ctype_char)
00280 {
00281 return ctype_string;
00282 }
00283 else if (c == ctype_void)
00284 {
00285 return ctype_voidPointer;
00286 }
00287 else
00288 {
00289 ctentry cte = ctype_getCtentry (c);
00290 ctype clp = ctentry_getPtr (cte);
00291
00292 if /*@+enumint@*/ (clp == CTK_DNE) /*@=enumint@*/
00293 {
00294 ctype cnew = cttable_addDerived (CTK_PTR, ctbase_makePointer (c), c);
00295 ctentry_setPtr (cte, cnew);
00296 return (cnew);
00297 }
00298 else
00299 {
00300 return clp;
00301 }
00302 }
00303 }
|
|
|
Definition at line 543 of file ctype.c. 00544 {
00545 return (cttable_addComplex (ctbase_makeRealFunction (base, p)));
00546 }
|
|
|
Definition at line 1454 of file ctype.c. Referenced by exprNode_cast(), exprNode_matchType(), processNamedDecl(), sRef_realSame(), and sRef_similarRelaxed(). 01455 {
01456 if (quickMatch (c1, c2))
01457 return TRUE;
01458
01459 if (ctype_isElips (c1))
01460 return (ctype_isElips (c2) || ctype_isUnknown (c2));
01461
01462 if (ctype_isElips (c2))
01463 return (ctype_isUnknown (c2));
01464
01465 return (ctbase_match (ctype_getCtbase (c1), ctype_getCtbase (c2)));
01466 }
|
|
|
Definition at line 1487 of file ctype.c. 01488 {
01489 if (quickMatch (c1, c2))
01490 {
01491 return TRUE;
01492 }
01493 else
01494 {
01495 return (ctbase_matchArg (ctype_getCtbase (c1), ctype_getCtbase (c2)));
01496 }
01497 }
|
|
|
Definition at line 1432 of file ctype.c. 01433 {
01434 if (quickMatch (c1, c2))
01435 return TRUE;
01436
01437 if (ctype_isElips (c1))
01438 return (ctype_isElips (c2) || ctype_isUnknown (c2));
01439
01440 if (ctype_isElips (c2))
01441 return (ctype_isUnknown (c2));
01442 else
01443 {
01444 bool oldrelax = context_getFlag (FLG_RELAXQUALS);
01445 bool res;
01446
01447 context_setFlagTemp (FLG_RELAXQUALS, FALSE);
01448 res = ctbase_matchDef (ctype_getCtbase (c1), ctype_getCtbase (c2));
01449 context_setFlagTemp (FLG_RELAXQUALS, oldrelax);
01450 return res;
01451 }
01452 }
|
|
|
Definition at line 395 of file ctype.c. Referenced by ctype_adjustPointers(), qtype_newBase(), and qtype_newQbase(). 00396 {
00397 return (ctbase_newBase (c, p));
00398 }
|
|
|
Definition at line 128 of file ctype.c. 00129 {
00130 cttable_print ();
00131 }
|
|
|
|
Definition at line 210 of file ctype.c. Referenced by exprNode_makeInitialization(), and exprNode_matchType(). 00211 {
00212 if (ctype_isUA (c))
00213 {
00214 if (ctype_isManifestBool (c))
00215 {
00216 return ctype_bool;
00217 }
00218 else
00219 {
00220 ctype r = uentry_getRealType (usymtab_getTypeEntry
00221 (ctype_typeId (c)));
00222 return (r);
00223 }
00224 }
00225
00226 return c;
00227 }
|
|
|
Definition at line 1950 of file ctype.c. 01951 {
01952 ctype oldc;
01953
01954 while (ctype_isArrayPtr (c))
01955 {
01956 oldc = c;
01957 c = ctype_baseArrayPtr (c);
01958 llassert (c != oldc);
01959 }
01960
01961 return (c);
01962 }
|
|
|
Definition at line 2278 of file ctype.c. Referenced by qtype_resolve(). 02279 {
02280 if (ctype_isUnknown (c)) return ctype_int;
02281 return c;
02282 }
|
|
|
Definition at line 1833 of file ctype.c. 01834 {
01835 /*
01836 ** returns longest type of c1 and c2
01837 */
01838
01839 if (c1 == c2) return c1;
01840
01841 c1 = ctype_realType (c1);
01842 c2 = ctype_realType (c2);
01843
01844 if (ctype_isEnum (c1)) c1 = ctype_unknown;
01845 if (ctype_isEnum (c2)) c2 = ctype_int;
01846
01847 if (c1 == ctype_ldouble || c2 == ctype_ldouble) return ctype_ldouble;
01848 if (c1 == ctype_ulint || c2 == ctype_ulint) return ctype_ulint;
01849 if (c1 == ctype_lint || c2 == ctype_lint) return ctype_lint;
01850 if (c1 == ctype_uint || c2 == ctype_uint) return ctype_uint;
01851 if (c1 == ctype_int || c2 == ctype_int) return ctype_int;
01852 if (c1 == ctype_sint || c2 == ctype_sint) return ctype_sint;
01853 if (c1 == ctype_uchar || c2 == ctype_uchar) return ctype_uchar;
01854 if (c1 == ctype_char || c2 == ctype_char) return ctype_char;
01855
01856 if (ctype_isKnown (c1)) return c1;
01857 else return c2;
01858 }
|
|
|
Definition at line 372 of file ctype.c. Referenced by checkDoneParams(), context_getRetType(), declareStaticFunction(), doneParams(), exprChecks_checkNullReturn(), exprNode_checkFunctionBody(), exprNode_checkMacroBody(), uentry_makeIdFunction(), uentry_reflectQualifiers(), and uentry_resetParams(). 00373 {
00374 return (ctbase_baseFunction (ctype_getCtbaseSafe (c)));
00375 }
|
|
|
Definition at line 401 of file ctype.c. 00402 {
00403 ctype c1a, c2a;
00404 ctype c1b, c2b;
00405
00406 llassert (ctype_isConj (c1) && ctype_isConj (c2));
00407
00408 c1a = ctype_getConjA (c1);
00409 c2a = ctype_getConjA (c2);
00410
00411 c1b = ctype_getConjB (c1);
00412 c2b = ctype_getConjB (c2);
00413
00414 if (ctype_compare (c1a, c2a) == 0)
00415 {
00416 if (ctype_compare (c1b, c2b) == 0)
00417 {
00418 return TRUE;
00419 }
00420 else
00421 {
00422 if (ctype_isConj (c1b) && ctype_isConj (c2b))
00423 {
00424 return ctype_sameAltTypes (c1b, c2b);
00425 }
00426 else
00427 {
00428 return FALSE;
00429 }
00430 }
00431 }
00432 else
00433 {
00434 if (ctype_compare (c1a, c2b) == 0)
00435 {
00436 if (ctype_compare (c1b, c2a) == 0)
00437 {
00438 return TRUE;
00439 }
00440 else
00441 {
00442 if (ctype_isConj (c1b) && ctype_isConj (c2a))
00443 {
00444 return ctype_sameAltTypes (c1b, c2a);
00445 }
00446 else
00447 {
00448 return FALSE;
00449 }
00450 }
00451 }
00452 else
00453 {
00454 return FALSE;
00455 }
00456 }
00457 }
|
|
|
Definition at line 1410 of file ctype.c. 01411 {
01412 if (quickMatch (c1, c2))
01413 return TRUE;
01414 else
01415 return (cstring_equal (ctype_unparse (c1), ctype_unparse (c2)));
01416 }
|
|
|
Definition at line 1592 of file ctype.c. Referenced by sRef_makeConst(), sRef_makeType(), uentry_getForceRealType(), uentry_getRealType(), uentry_setAbstract(), and usymtab_matchForwardStruct(). 01593 {
01594 return (ctbase_typeId (ctype_getCtbase (c)));
01595 }
|
|
|
Definition at line 1670 of file ctype.c. Referenced by uentry_undump(). 01671 {
01672 return ((ctype) getInt (c)); /* check its valid? */
01673 }
|
|
|
Definition at line 1605 of file ctype.c. Referenced by ctype_combine(), ctype_genMatch(), ctype_makeConj(), ctype_sameName(), exprNode_assign(), exprNode_checkMacroBody(), exprNode_matchLiteral(), exprNode_numLiteral(), modListArrayFetch(), modListArrowAccess(), modListFieldAccess(), modListPointer(), processNamedDecl(), qtype_unparse(), specialClauses_checkAll(), uentryList_showFieldDifference(), uentry_checkParams(), uentry_makeEnumInitializedConstant(), and uentry_makeParam(). 01606 {
01607 if (ctype_isElips (c))
01608 {
01609 return cstring_makeLiteralTemp ("...");
01610 }
01611 else if (ctype_isMissingParamsMarker (c))
01612 {
01613 return cstring_makeLiteralTemp ("-");
01614 }
01615 else
01616 {
01617 /*@-modobserver@*/
01618 return (ctentry_doUnparse (ctype_getCtentry (c)));
01619 /*@=modobserver@*/
01620 }
01621 }
|
|
|
Definition at line 1598 of file ctype.c. Referenced by uentry_unparse(). 01599 {
01600 llassert (!(ctype_isElips (c) || ctype_isMissingParamsMarker (c)));
01601 return (ctbase_unparseDeclaration (ctype_getCtbase (c), name));
01602 }
|
|
|
Definition at line 1655 of file ctype.c. 01656 {
01657 if (ctype_isElips (c))
01658 {
01659 return cstring_makeLiteralTemp ("...");
01660 }
01661 if (ctype_isMissingParamsMarker (c))
01662 {
01663 return cstring_makeLiteralTemp ("-");
01664 }
01665
01666 return (ctentry_doUnparseDeep (ctype_getCtentry (c)));
01667 }
|
|
|
Definition at line 1624 of file ctype.c. 01625 {
01626 if (ctype_isElips (c))
01627 {
01628 return cstring_makeLiteralTemp ("...");
01629 }
01630 else if (ctype_isMissingParamsMarker (c))
01631 {
01632 return cstring_makeLiteralTemp ("-");
01633 }
01634 else
01635 {
01636 cstring ret;
01637
01638 if /*@+enumint@*/ (c >= CTK_PLAIN && c < cttab.size) /*@=enumint@*/
01639 {
01640 ctentry cte = ctype_getCtentry (c);
01641
01642 if (cstring_isDefined (cte->unparse))
01643 {
01644 return (cte->unparse);
01645 }
01646 }
01647
01648 ret = message ("[%d]", (int) c);
01649 cstring_markOwned (ret);
01650 return ret;
01651 }
01652 }
|
|
|
Definition at line 122 of file ctype.c. 00123 {
00124 return (cttable_unparse ());
00125 }
|
|
|
Definition at line 2358 of file ctype.c. 02359 {
02360 if (ctype_isMoreUnsigned (c2, c1)
02361 || ctype_isLonger (c2, c1))
02362 {
02363 return c2;
02364 }
02365 else
02366 {
02367 return c1;
02368 }
02369 }
|
1.2.3 written by Dimitri van Heesch,
© 1997-2000