Changeset 666
- Timestamp:
- Sep 9, 2003, 1:17:27 AM (22 years ago)
- Location:
- trunk/src/gcc/gcc/config/i386
- Files:
-
- 2 edited
-
emx.c (modified) (7 diffs, 1 prop)
-
i386.c (modified) (7 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gcc/gcc/config/i386/emx.c
-
Property cvs2svn:cvs-rev
changed from
1.21to1.22
r665 r666 31 31 #include "flags.h" 32 32 #include "i386-protos.h" 33 33 34 34 35 /* The size of the target's pointer type. */ … … 72 73 } 73 74 74 static void dump (tree node); 75 static void dump (tree node) 75 const char *birddump_callingconv(tree node); 76 const char *birddump_callingconv(tree node) 77 { 78 static const char *apsz[] = {"system", "optlink", "stdcall"}; 79 static const char *psznone = "none"; 80 static const char *pszdefault = "default"; 81 tree attr; 82 unsigned i; 83 84 if (!node) 85 return psznone; 86 87 attr = (DECL_P (node) ? DECL_ATTRIBUTES (node) : TYPE_ATTRIBUTES (node)); 88 if (!attr) 89 return pszdefault; 90 91 for (i = 0; i < sizeof(apsz) / sizeof(apsz[0]); i++) 92 if (node && attr && lookup_attribute (apsz[i], attr)) 93 return apsz[i]; 94 95 return pszdefault; 96 } 97 98 void birddump (tree node); 99 void birddump (tree node) 76 100 { 77 101 tree type, type2, context, name; … … 83 107 context = DECL_P (node) ? DECL_CONTEXT (node) : NULL_TREE; 84 108 name = DECL_P (node) ? DECL_NAME (node) : NULL_TREE; 85 fprintf(stderr, "dbg: node=%d %s type=%d %s type_type=%d %s context=%d %s name=%s\n", 86 TREE_CODE(node), code(node), 87 type ? (int)TREE_CODE(type) : -1, code(type), 88 type2 ? (int)TREE_CODE(type2) : -1, code(type2), 89 context ? (int)TREE_CODE(context) : -1, code(context), 109 110 fprintf(stderr, "dbg: node=%d %s %p %s type=%d %s %p %s type_type=%d %s %p %s context=%d %s %p name=%s\n", 111 TREE_CODE(node), code(node), (void*)node, birddump_callingconv(node), 112 type ? (int)TREE_CODE(type) : -1, code(type), (void*)type, birddump_callingconv(type), 113 type2 ? (int)TREE_CODE(type2) : -1, code(type2), (void*)type2, birddump_callingconv(type2), 114 context ? (int)TREE_CODE(context) : -1, code(context), (void*)context, 90 115 name ? IDENTIFIER_POINTER (name) : "<none>"); 91 116 } 92 117 93 118 #define dfprintf(a) fprintf a 94 #define DUMP(node) dump(node)119 #define DUMP(node) dump(node) 95 120 #else 96 121 #define dfprintf(a) do {} while (0) … … 112 137 return 0; 113 138 139 140 141 142 143 144 145 114 146 recurse++; 115 116 147 type = TREE_TYPE (decl); 117 148 … … 205 236 } 206 237 238 239 240 207 241 tree emx_handle_vacpp_attribute (tree *node, tree name, tree args, 208 242 int flags, bool *no_add_attrs) 209 243 { 244 210 245 (void) args; 211 246 (void) flags; 212 247 248 213 249 DUMP (*node); 214 250 … … 233 269 return NULL_TREE; 234 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 235 289 return NULL_TREE; 236 290 } 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 237 391 238 392 void … … 265 419 } 266 420 } 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/gcc/gcc/config/i386/i386.c
-
Property cvs2svn:cvs-rev
changed from
1.12to1.13
r665 r666 1273 1273 { 1274 1274 /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */ 1275 1276 1277 1278 1279 1280 1281 1275 1282 /* Stdcall attribute says callee is responsible for popping arguments 1276 1283 if they are not variable. */ … … 1278 1285 /* Cdecl attribute says the callee is a normal C declaration */ 1279 1286 { "cdecl", 0, 0, false, true, true, ix86_handle_cdecl_attribute }, 1287 1280 1288 /* Regparm attribute specifies how many integer arguments are to be 1281 1289 passed in registers. */ … … 1286 1294 { "shared", 0, 0, true, false, false, ix86_handle_shared_attribute }, 1287 1295 #endif 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1288 1306 #ifdef TARGET_SYSTEM_DECL_ATTRIBUTES 1289 1307 /* System says the function is extern "C" and is not underscored. */ … … 1293 1311 /* Optlink is like regparm with a few differences */ 1294 1312 { "optlink", 0, 0, false, true, true, ix86_handle_optlink_attribute }, 1313 1295 1314 #endif 1296 1315 { NULL, 0, 0, false, false, false, NULL } … … 1558 1577 unsigned i, cc1 = 0, cc2 = 0; 1559 1578 1560 /* The following calling conventions have meaning only for functions */ 1561 if (TREE_CODE (type1) != FUNCTION_TYPE) 1579 /* The following calling conventions have meaning only for functions, 1580 methods and pointers to such. */ 1581 if (TREE_CODE (type1) == POINTER_TYPE) 1582 type1 = TREE_TYPE(type1); 1583 if (TREE_CODE (type2) == POINTER_TYPE) 1584 type2 = TREE_TYPE(type2); 1585 if ( TREE_CODE (type1) != FUNCTION_TYPE 1586 && TREE_CODE (type1) != METHOD_TYPE 1587 && TREE_CODE (type2) != FUNCTION_TYPE 1588 && TREE_CODE (type2) != METHOD_TYPE) 1562 1589 return 1; 1563 1590 1564 /*@@@todo: this doesn't work yet because of some bug somewhere inside gcc.1565 testcase for both C and C++:1566 void f (); static void (* _Optlink x) () = f; <-- compiles ok1567 testcase for C++:1568 void _Optlink f (); static void (* _Optlink x) () = f; <-- bad types1569 */1570 #if __ANNOYING_BUG_IN_GCC_IS_FINALLY_FIXED1571 1591 /* The function may have only one calling convention. 1572 1592 * For simplicity we translate the calling conversion attribute … … 1576 1596 * (e.g. issue a warning but allow the operation). 1577 1597 */ 1578 1579 1598 for (i = 0; ix86_attribute_table [i].name; i++) 1580 1599 if (ix86_attribute_codes [i] & IX86_ATTR_TYPE_CALLCONV) … … 1601 1620 /* They are nearly compatible */ 1602 1621 return 2; 1603 #else1604 return 1;1605 #endif1606 1622 } 1607 1623 -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.
