{
case V_INT: {
if (SPEC_LONG(sl)) return "long";
- if (sl->select.s._short) return "short";
+ if (SPEC_SHORT(sl)) return "short";
return "int";
}
case V_FLOAT: return "float";
SPEC_NOUN(etype)==V_FIXED16X16 ||
SPEC_NOUN(etype)==V_DOUBLE ||
SPEC_NOUN(etype)==V_VOID) &&
- (etype->select.s._short || SPEC_LONG(etype))) {
+ (SPEC_SHORT(etype) || SPEC_LONG(etype))) {
// long or short for char float double or void
werror (E_LONG_OR_SHORT_INVALID, noun, name);
}
SPEC_NOUN(etype)==V_FIXED16X16 ||
SPEC_NOUN(etype)==V_DOUBLE ||
SPEC_NOUN(etype)==V_VOID) &&
- (etype->select.s._signed || SPEC_USIGN(etype))) {
+ (etype->select.s.b_signed || SPEC_USIGN(etype))) {
// signed or unsigned for float double or void
werror (E_SIGNED_OR_UNSIGNED_INVALID, noun, name);
}
// special case for "short"
- if (etype->select.s._short) {
+ if (SPEC_SHORT(etype)) {
SPEC_NOUN(etype) = options.shortis8bits ? V_CHAR : V_INT;
- etype->select.s._short = 0;
+ SPEC_SHORT(etype) = 0;
}
/* if no noun e.g.
/* a "plain" int bitfield is unsigned */
if (SPEC_NOUN(etype)==V_BIT ||
SPEC_NOUN(etype)==V_SBIT) {
- if (!etype->select.s._signed)
+ if (!etype->select.s.b_signed)
SPEC_USIGN(etype) = 1;
}
- if (etype->select.s._signed && SPEC_USIGN(etype)) {
+ if (etype->select.s.b_signed && SPEC_USIGN(etype)) {
// signed AND unsigned
werror (E_SIGNED_AND_UNSIGNED_INVALID, noun, name);
}
- if (etype->select.s._short && SPEC_LONG(etype)) {
+ if (SPEC_SHORT(etype) && SPEC_LONG(etype)) {
// short AND long
werror (E_LONG_AND_SHORT_INVALID, noun, name);
}
// but there are more important thing right now
SPEC_LONG (dest) |= SPEC_LONG (src);
- dest->select.s._short|=src->select.s._short;
+ SPEC_SHORT(dest) |= SPEC_SHORT(src);
SPEC_USIGN (dest) |= SPEC_USIGN (src);
- dest->select.s._signed|=src->select.s._signed;
+ dest->select.s.b_signed|=src->select.s.b_signed;
SPEC_STAT (dest) |= SPEC_STAT (src);
SPEC_EXTR (dest) |= SPEC_EXTR (src);
SPEC_CONST(dest) |= SPEC_CONST (src);
return p;
}
+/*------------------------------------------------------------------*/
+/* newBoolLink() - creates an bool type */
+/*------------------------------------------------------------------*/
+sym_link *
+newBoolLink ()
+{
+ sym_link *p;
+
+ p = newLink (SPECIFIER);
+ SPEC_NOUN (p) = V_BIT;
+
+ return p;
+}
+
/*------------------------------------------------------------------*/
/* getSize - returns size of a type chain in bits */
/*------------------------------------------------------------------*/
/* if this is an automatic symbol */
if (sym->level && (options.stackAuto || reentrant)) {
- if ((SPEC_SCLS (sym->etype) == S_AUTO ||
- SPEC_SCLS (sym->etype) == S_FIXED ||
- SPEC_SCLS (sym->etype) == S_REGISTER ||
- SPEC_SCLS (sym->etype) == S_STACK ||
- SPEC_SCLS (sym->etype) == S_XSTACK)) {
- SPEC_SCLS (sym->etype) = S_AUTO;
- } else {
- /* storage class may only be specified for statics */
- if (!IS_STATIC(sym->etype)) {
- werror (E_AUTO_ASSUMED, sym->name);
+ if (SPEC_SCLS (sym->etype) != S_BIT) {
+ if ((SPEC_SCLS (sym->etype) == S_AUTO ||
+ SPEC_SCLS (sym->etype) == S_FIXED ||
+ SPEC_SCLS (sym->etype) == S_REGISTER ||
+ SPEC_SCLS (sym->etype) == S_STACK ||
+ SPEC_SCLS (sym->etype) == S_XSTACK)) {
+ SPEC_SCLS (sym->etype) = S_AUTO;
+ } else {
+ /* storage class may only be specified for statics */
+ if (!IS_STATIC(sym->etype)) {
+ werror (E_AUTO_ASSUMED, sym->name);
+ }
}
}
}
/* arrays & pointers cannot be defined for bits */
/* SBITS or SFRs or BIT */
if ((IS_ARRAY (sym->type) || IS_PTR (sym->type)) &&
+ !IS_FUNCPTR (sym->type) &&
(SPEC_NOUN (sym->etype) == V_BIT ||
SPEC_NOUN (sym->etype) == V_SBIT ||
SPEC_NOUN (sym->etype) == V_BITFIELD ||
reType = getSpec (rType);
/* avoid conflicting types */
- reType->select.s._signed = 0;
+ reType->select.s.b_signed = 0;
/* if result is a literal then make not so */
if (IS_LITERAL (reType))
return 0;
}
- /* function cannot return bit */
- if (IS_BITVAR (sym->type->next))
- {
- werror (E_FUNC_BIT, sym->name);
- return 0;
- }
-
/* check if this function is defined as calleeSaves
then mark it as such */
FUNC_CALLEESAVES(sym->type) = inCalleeSaveList (sym->name);
the function does not have VA_ARG
and as port dictates */
if (!IFFUNC_HASVARARGS(funcType) &&
- (argreg = (*port->reg_parm) (val->type)))
+ (argreg = (*port->reg_parm) (val->type, FUNC_ISREENT(funcType))))
{
SPEC_REGPARM (val->etype) = 1;
SPEC_ARGREG(val->etype) = argreg;