Changeset 617
- Timestamp:
- Aug 16, 2003, 10:07:31 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gcc/gcc/config/i386/i386.c
-
Property cvs2svn:cvs-rev
changed from
1.8
to1.9
r616 r617 1297 1297 }; 1298 1298 1299 /* The attribute denotes a calling convention */ 1300 #define IX86_ATTR_TYPE_CALLCONV 0x00010000 1301 /* Calling convention mask: attributes with bits 1302 in these positions equal are nealy compatible */ 1303 #define IX86_ATTR_MASK_CALLCONV 0x0000000f 1304 /* Ordinal number for attributes with equal calling convention bits */ 1305 #define IX86_ATTR_MASK_ORDINAL 0x000000f0 1306 1307 /* This array contains some flags containing additional information 1308 about attributes. Keep it in sync with ix86_attribute_table. */ 1309 static unsigned ix86_attribute_codes [] = 1310 { 1311 IX86_ATTR_TYPE_CALLCONV | 0x01, /* stdcall */ 1312 IX86_ATTR_TYPE_CALLCONV | 0x02, /* cdecl */ 1313 IX86_ATTR_TYPE_CALLCONV | 0x03, /* regparm */ 1314 #ifdef TARGET_DLLIMPORT_DECL_ATTRIBUTES 1315 0, /* dllimport */ 1316 0, /* dllexport */ 1317 0, /* shared */ 1318 #endif 1319 #ifdef TARGET_SYSTEM_DECL_ATTRIBUTES 1320 IX86_ATTR_TYPE_CALLCONV | 0x12, /* system is compatible with cdecl */ 1321 #endif 1322 #ifdef TARGET_OPTLINK_DECL_ATTRIBUTES 1323 IX86_ATTR_TYPE_CALLCONV | 0x04, /* optlink */ 1324 #endif 1325 }; 1326 1327 1299 1328 /* Check if we don't have incompatible calling conversion attributes */ 1300 1329 int … … 1324 1353 1325 1354 for (i = 0; ix86_attribute_table [i].name; i++) 1326 if (lookup_attribute (ix86_attribute_table [i].name, TYPE_ATTRIBUTES (type))) 1355 if ((ix86_attribute_codes [i] & IX86_ATTR_TYPE_CALLCONV) 1356 && lookup_attribute (ix86_attribute_table [i].name, TYPE_ATTRIBUTES (type))) 1327 1357 { 1328 1358 /* Warn if we have another calling convention attribute and it is … … 1526 1556 tree type2; 1527 1557 { 1528 unsigned i; 1529 unsigned char cc1 = 0, cc2 = 0; 1530 /* WARNING! Keep in sync with ix86_attribute_table!!! */ 1531 unsigned char attrcode [] = 1532 { 1533 0x10, // stdcall 1534 0x20, // cdecl 1535 0x30, // regparm 1536 #ifdef TARGET_DLLIMPORT_DECL_ATTRIBUTES 1537 0x40, // dllimport 1538 0x50, // dllexport 1539 0x60, // shared 1540 #endif 1541 #ifdef TARGET_SYSTEM_DECL_ATTRIBUTES 1542 0x21, // system is compatible with cdecl 1543 #endif 1544 #ifdef TARGET_OPTLINK_DECL_ATTRIBUTES 1545 0x70, // optlink 1546 #endif 1547 }; 1558 unsigned i, cc1 = 0, cc2 = 0; 1548 1559 1549 1560 /* The following calling conventions have meaning only for functions */ … … 1560 1571 1561 1572 for (i = 0; ix86_attribute_table [i].name; i++) 1562 { 1563 if (lookup_attribute (ix86_attribute_table [i].name, TYPE_ATTRIBUTES (type1))) 1564 cc1 = attrcode [i]; 1565 if (lookup_attribute (ix86_attribute_table [i].name, TYPE_ATTRIBUTES (type2))) 1566 cc2 = attrcode [i]; 1567 } 1573 if (ix86_attribute_codes [i] & IX86_ATTR_TYPE_CALLCONV) 1574 { 1575 if (lookup_attribute (ix86_attribute_table [i].name, TYPE_ATTRIBUTES (type1))) 1576 cc1 = ix86_attribute_codes [i]; 1577 if (lookup_attribute (ix86_attribute_table [i].name, TYPE_ATTRIBUTES (type2))) 1578 cc2 = ix86_attribute_codes [i]; 1579 } 1568 1580 1569 1581 if (!cc1) 1570 cc1 = TARGET_RTD ? 0x10 : 0x20;1582 cc1 = ix86_attribute_codes [TARGET_RTD ? 0 : 1]; 1571 1583 if (!cc2) 1572 cc2 = TARGET_RTD ? 0x10 : 0x20;1584 cc2 = ix86_attribute_codes [TARGET_RTD ? 0 : 1]; 1573 1585 1574 1586 /* If calling conventions are the same, its okay */ … … 1577 1589 1578 1590 /* If they are not compatible, return 0 */ 1579 if ((cc1 ^ cc2) & 0xf0)1591 if ((cc1 ^ cc2) & IX86_ATTR_MASK_CALLCONV) 1580 1592 return 0; 1581 1593 -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.