Changeset 615


Ignore:
Timestamp:
Aug 16, 2003, 9:31:23 PM (22 years ago)
Author:
zap
Message:

.

Location:
trunk/src/gcc/gcc/config/i386
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gcc/gcc/config/i386/emx.c

    • Property cvs2svn:cvs-rev changed from 1.16 to 1.17
    r614 r615  
    9595#endif
    9696
    97 
    9897tree ix86_handle_vacpp_attribute (tree *node, tree name, tree args,
    9998  int flags, bool *no_add_attrs)
     
    113112           an attached attribute (either optlink or system).
    114113           This is the only part which is changing the mangling. */
     114
     115
     116
     117
     118
     119
    115120        if (is_attribute_p ("system", name))
    116121          {
     
    122127                CLASSTYPE_DECLARED_CLASS (meaning it doesn't apply to plain
    123128                structs/unions) ? */
    124             if (   TREE_CODE (TREE_TYPE (*node)) != METHOD_TYPE
     129            if (   TREE_CODE () != METHOD_TYPE
    125130                && (   !(context = DECL_CONTEXT (*node))
    126131                    || (   TREE_CODE (context) != RECORD_TYPE
     
    171176        /* The attribute should really be attached to our _TYPE
    172177           rather than to the _DECL. */
    173         type = TREE_TYPE (*node);
    174178        TYPE_ATTRIBUTES (type) = chainon (TYPE_ATTRIBUTES (type),
    175179                                          tree_cons (name, args, NULL_TREE));
     
    192196            || TREE_CODE (type) == METHOD_TYPE)
    193197          {
     198
     199
     200
    194201            /* Attach the attribute to the (FUNCTION|METHOD)_TYPE node */
    195202            TYPE_ATTRIBUTES (type) = chainon (TYPE_ATTRIBUTES (type),
     
    198205            break;
    199206          }
    200         warning ("`%s' attribute only applies to functions and function types (typecode=%d)",
    201                  IDENTIFIER_POINTER (name), type ? (int)TREE_CODE (type) : -1);
     207        warning ("`%s' attribute only applies to functions and function types",
     208                 IDENTIFIER_POINTER (name));
    202209        *no_add_attrs = true;
    203210        break;
  • trunk/src/gcc/gcc/config/i386/i386-protos.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r614 r615  
    183183
    184184#ifdef TREE_CODE
     185
     186
    185187extern int ix86_return_pops_args PARAMS ((tree, tree, int));
    186188extern tree ix86_build_va_list PARAMS ((void));
  • trunk/src/gcc/gcc/config/i386/i386.c

    • Property cvs2svn:cvs-rev changed from 1.6 to 1.7
    r614 r615  
    12961296};
    12971297
     1298
     1299
     1300
     1301
     1302
     1303
     1304
     1305
     1306
     1307
     1308
     1309
     1310
     1311
     1312
     1313
     1314
     1315
     1316
     1317
     1318
     1319
     1320
     1321
     1322
     1323
     1324
     1325
     1326
     1327
     1328
     1329
     1330
     1331
     1332
     1333
     1334
     1335
     1336
     1337
     1338
     1339
     1340
     1341
     1342
     1343
     1344
     1345
     1346
     1347
     1348
     1349
     1350
     1351
     1352
    12981353/* Handle a "cdecl" or "stdcall" attribute;
    12991354   arguments as in struct attribute_spec.handler.  */
     
    13221377    }
    13231378
     1379
     1380
     1381
     1382
    13241383  return NULL_TREE;
    13251384}
     
    13631422    }
    13641423
     1424
     1425
     1426
     1427
    13651428  return NULL_TREE;
    13661429}
     
    14741537     tree type2;
    14751538{
    1476   /* Check for mismatch of non-default calling convention.  */
    1477   const char *const rtdstr = TARGET_RTD ? "cdecl" : "stdcall";
    1478 
    1479 /*
    1480 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ TODO: check for optlink and system
    1481 #ifdef SUBTARGET_COMP_TYPE_ATTRIBUTES
    1482   SUBTARGET_COMP_TYPE_ATTRIBUTES
     1539  unsigned i;
     1540  unsigned char cc1 = 0, cc2 = 0;
     1541  static struct
     1542  {
     1543    const char *attr;
     1544    unsigned char flag;
     1545  } typecode [] =
     1546  {
     1547    { "cdecl",   0x10 },
     1548    { "stdcall", 0x20 },
     1549    { "regparm", 0x30 },
     1550#ifdef TARGET_SYSTEM_DECL_ATTRIBUTES
     1551    { "system",  0x11 },
    14831552#endif
    1484 */
    1485 
     1553#ifdef TARGET_OPTLINK_DECL_ATTRIBUTES
     1554    { "optlink", 0x40 },
     1555#endif
     1556  };
     1557
     1558  /* The following calling conventions have meaning only for functions */
    14861559  if (TREE_CODE (type1) != FUNCTION_TYPE)
    14871560    return 1;
    14881561
    1489   /* Check for mismatched return types (cdecl vs stdcall).  */
    1490   if (!lookup_attribute (rtdstr, TYPE_ATTRIBUTES (type1))
    1491       != !lookup_attribute (rtdstr, TYPE_ATTRIBUTES (type2)))
     1562  /* The function may have only one calling convention.
     1563   * For simplicity we translate the calling conversion attribute
     1564   * to a numeric constant, then the numbers are compared.
     1565   *
     1566   * If the top 4 bits are the same, the types are compatible
     1567   * (e.g. issue a warning but allow the operation).
     1568   */
     1569
     1570  for (i = 0; i < sizeof (typecode) / sizeof (typecode [0]); i++)
     1571    {
     1572      if (lookup_attribute (typecode [i].attr, TYPE_ATTRIBUTES (type1)))
     1573        cc1 = typecode [i].flag;
     1574      if (lookup_attribute (typecode [i].attr, TYPE_ATTRIBUTES (type2)))
     1575        cc2 = typecode [i].flag;
     1576    }
     1577
     1578  if (!cc1)
     1579    cc1 = TARGET_RTD ? 0x20 : 0x10;
     1580  if (!cc2)
     1581    cc2 = TARGET_RTD ? 0x20 : 0x10;
     1582
     1583  /* If calling conventions are the same, its okay */
     1584  if (cc1 == cc2)
     1585    return 1;
     1586
     1587  /* If they are not compatible, return 0 */
     1588  if ((cc1 ^ cc2) & 0xf0)
    14921589    return 0;
    1493   return 1;
     1590
     1591  /* They are nearly compatible, issue a warning */
     1592  return 2;
    14941593}
    14951594
Note: See TracChangeset for help on using the changeset viewer.