Changeset 615
- Timestamp:
- Aug 16, 2003, 9:31:23 PM (22 years ago)
- Location:
- trunk/src/gcc/gcc/config/i386
- Files:
-
- 3 edited
-
emx.c (modified) (6 diffs, 1 prop)
-
i386-protos.h (modified) (1 diff, 1 prop)
-
i386.c (modified) (4 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gcc/gcc/config/i386/emx.c
-
Property cvs2svn:cvs-rev
changed from
1.16to1.17
r614 r615 95 95 #endif 96 96 97 98 97 tree ix86_handle_vacpp_attribute (tree *node, tree name, tree args, 99 98 int flags, bool *no_add_attrs) … … 113 112 an attached attribute (either optlink or system). 114 113 This is the only part which is changing the mangling. */ 114 115 116 117 118 119 115 120 if (is_attribute_p ("system", name)) 116 121 { … … 122 127 CLASSTYPE_DECLARED_CLASS (meaning it doesn't apply to plain 123 128 structs/unions) ? */ 124 if ( TREE_CODE ( TREE_TYPE (*node)) != METHOD_TYPE129 if ( TREE_CODE () != METHOD_TYPE 125 130 && ( !(context = DECL_CONTEXT (*node)) 126 131 || ( TREE_CODE (context) != RECORD_TYPE … … 171 176 /* The attribute should really be attached to our _TYPE 172 177 rather than to the _DECL. */ 173 type = TREE_TYPE (*node);174 178 TYPE_ATTRIBUTES (type) = chainon (TYPE_ATTRIBUTES (type), 175 179 tree_cons (name, args, NULL_TREE)); … … 192 196 || TREE_CODE (type) == METHOD_TYPE) 193 197 { 198 199 200 194 201 /* Attach the attribute to the (FUNCTION|METHOD)_TYPE node */ 195 202 TYPE_ATTRIBUTES (type) = chainon (TYPE_ATTRIBUTES (type), … … 198 205 break; 199 206 } 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)); 202 209 *no_add_attrs = true; 203 210 break; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/gcc/gcc/config/i386/i386-protos.h
-
Property cvs2svn:cvs-rev
changed from
1.1to1.2
r614 r615 183 183 184 184 #ifdef TREE_CODE 185 186 185 187 extern int ix86_return_pops_args PARAMS ((tree, tree, int)); 186 188 extern tree ix86_build_va_list PARAMS ((void)); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/gcc/gcc/config/i386/i386.c
-
Property cvs2svn:cvs-rev
changed from
1.6to1.7
r614 r615 1296 1296 }; 1297 1297 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 1298 1353 /* Handle a "cdecl" or "stdcall" attribute; 1299 1354 arguments as in struct attribute_spec.handler. */ … … 1322 1377 } 1323 1378 1379 1380 1381 1382 1324 1383 return NULL_TREE; 1325 1384 } … … 1363 1422 } 1364 1423 1424 1425 1426 1427 1365 1428 return NULL_TREE; 1366 1429 } … … 1474 1537 tree type2; 1475 1538 { 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 }, 1483 1552 #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 */ 1486 1559 if (TREE_CODE (type1) != FUNCTION_TYPE) 1487 1560 return 1; 1488 1561 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) 1492 1589 return 0; 1493 return 1; 1590 1591 /* They are nearly compatible, issue a warning */ 1592 return 2; 1494 1593 } 1495 1594 -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.
