Changeset 616
- Timestamp:
- Aug 16, 2003, 9:45:29 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.7
to1.8
r615 r616 1268 1268 1269 1269 1270 /* Table of valid machine attributes. */ 1270 /* Table of valid machine attributes. If you change it, you must change the array at 1271 the beginning of ix86_comp_type_attributes() as well! */ 1271 1272 const struct attribute_spec ix86_attribute_table[] = 1272 1273 { … … 1303 1304 unsigned i; 1304 1305 const char *exclname; 1305 static const char *cc [] =1306 {1307 "cdecl",1308 "stdcall",1309 "regparm",1310 #ifdef TARGET_SYSTEM_DECL_ATTRIBUTES1311 "system",1312 #endif1313 #ifdef TARGET_OPTLINK_DECL_ATTRIBUTES1314 "optlink",1315 #endif1316 };1317 1306 1318 1307 exclname = IDENTIFIER_POINTER (name); … … 1334 1323 } 1335 1324 1336 for (i = 0; i < sizeof (cc) / sizeof (const char *); i++)1337 if (lookup_attribute ( cc [i], TYPE_ATTRIBUTES (type)))1325 for (i = 0; ix86_attribute_table [i].name; i++) 1326 if (lookup_attribute (ix86_attribute_table [i].name, TYPE_ATTRIBUTES (type))) 1338 1327 { 1339 1328 /* Warn if we have another calling convention attribute and it is … … 1341 1330 already an attribute with the same name attached, silently ignore 1342 1331 currently processed attribute. */ 1343 if (strcmp (exclname, cc [i]))1332 if (strcmp (exclname, ix86_attribute_table [i].name)) 1344 1333 warning ("`%s' attribute is incompatible with earlier defined `%s' attribute", 1345 IDENTIFIER_POINTER (name), cc [i]);1334 IDENTIFIER_POINTER (name), ix86_attribute_table [i].name); 1346 1335 *no_add_attrs = true; 1347 1336 return -1; … … 1539 1528 unsigned i; 1540 1529 unsigned char cc1 = 0, cc2 = 0; 1541 static struct 1530 /* WARNING! Keep in sync with ix86_attribute_table!!! */ 1531 unsigned char attrcode [] = 1542 1532 { 1543 const char *attr; 1544 unsigned char flag; 1545 } typecode [] = 1546 { 1547 { "cdecl", 0x10 }, 1548 { "stdcall", 0x20 }, 1549 { "regparm", 0x30 }, 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 1550 1541 #ifdef TARGET_SYSTEM_DECL_ATTRIBUTES 1551 { "system", 0x11 },1542 0x21, // system is compatible with cdecl 1552 1543 #endif 1553 1544 #ifdef TARGET_OPTLINK_DECL_ATTRIBUTES 1554 { "optlink", 0x40 },1545 0x70, // optlink 1555 1546 #endif 1556 1547 }; … … 1568 1559 */ 1569 1560 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;1561 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]; 1576 1567 } 1577 1568 1578 1569 if (!cc1) 1579 cc1 = TARGET_RTD ? 0x 20 : 0x10;1570 cc1 = TARGET_RTD ? 0x10 : 0x20; 1580 1571 if (!cc2) 1581 cc2 = TARGET_RTD ? 0x 20 : 0x10;1572 cc2 = TARGET_RTD ? 0x10 : 0x20; 1582 1573 1583 1574 /* If calling conventions are the same, its okay */ … … 1589 1580 return 0; 1590 1581 1591 /* They are nearly compatible , issue a warning*/1582 /* They are nearly compatible */ 1592 1583 return 2; 1593 1584 } -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.