Mercurial > hg > CbC > CbC_gcc
comparison gcc/gimple.h @ 57:326d9e06c2e3
modify c-parser.c
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 15 Feb 2010 00:54:17 +0900 |
parents | 9de9dad105d4 77e2b8dfacca |
children | 1b10fe6932e1 |
comparison
equal
deleted
inserted
replaced
54:f62c169bbc24 | 57:326d9e06c2e3 |
---|---|
32 | 32 |
33 DEF_VEC_P(gimple); | 33 DEF_VEC_P(gimple); |
34 DEF_VEC_ALLOC_P(gimple,heap); | 34 DEF_VEC_ALLOC_P(gimple,heap); |
35 DEF_VEC_ALLOC_P(gimple,gc); | 35 DEF_VEC_ALLOC_P(gimple,gc); |
36 | 36 |
37 typedef gimple *gimple_p; | |
38 DEF_VEC_P(gimple_p); | |
39 DEF_VEC_ALLOC_P(gimple_p,heap); | |
40 | |
37 DEF_VEC_P(gimple_seq); | 41 DEF_VEC_P(gimple_seq); |
38 DEF_VEC_ALLOC_P(gimple_seq,gc); | 42 DEF_VEC_ALLOC_P(gimple_seq,gc); |
39 DEF_VEC_ALLOC_P(gimple_seq,heap); | 43 DEF_VEC_ALLOC_P(gimple_seq,heap); |
40 | 44 |
41 /* For each block, the PHI nodes that need to be rewritten are stored into | 45 /* For each block, the PHI nodes that need to be rewritten are stored into |
63 #define GIMPLE_CHECK(GS, CODE) \ | 67 #define GIMPLE_CHECK(GS, CODE) \ |
64 do { \ | 68 do { \ |
65 const_gimple __gs = (GS); \ | 69 const_gimple __gs = (GS); \ |
66 if (gimple_code (__gs) != (CODE)) \ | 70 if (gimple_code (__gs) != (CODE)) \ |
67 gimple_check_failed (__gs, __FILE__, __LINE__, __FUNCTION__, \ | 71 gimple_check_failed (__gs, __FILE__, __LINE__, __FUNCTION__, \ |
68 (CODE), 0); \ | 72 (CODE), ERROR_MARK); \ |
69 } while (0) | 73 } while (0) |
70 #else /* not ENABLE_GIMPLE_CHECKING */ | 74 #else /* not ENABLE_GIMPLE_CHECKING */ |
71 #define GIMPLE_CHECK(GS, CODE) (void)0 | 75 #define GIMPLE_CHECK(GS, CODE) (void)0 |
72 #endif | 76 #endif |
73 | 77 |
114 | 118 |
115 GF_OMP_SECTION_LAST = 1 << 0, | 119 GF_OMP_SECTION_LAST = 1 << 0, |
116 GF_PREDICT_TAKEN = 1 << 15 | 120 GF_PREDICT_TAKEN = 1 << 15 |
117 }; | 121 }; |
118 | 122 |
123 /* Currently, there's only one type of gimple debug stmt. Others are | |
124 envisioned, for example, to enable the generation of is_stmt notes | |
125 in line number information, to mark sequence points, etc. This | |
126 subcode is to be used to tell them apart. */ | |
127 enum gimple_debug_subcode { | |
128 GIMPLE_DEBUG_BIND = 0 | |
129 }; | |
130 | |
119 /* Masks for selecting a pass local flag (PLF) to work on. These | 131 /* Masks for selecting a pass local flag (PLF) to work on. These |
120 masks are used by gimple_set_plf and gimple_plf. */ | 132 masks are used by gimple_set_plf and gimple_plf. */ |
121 enum plf_mask { | 133 enum plf_mask { |
122 GF_PLF_1 = 1 << 0, | 134 GF_PLF_1 = 1 << 0, |
123 GF_PLF_2 = 1 << 1 | 135 GF_PLF_2 = 1 << 1 |
124 }; | 136 }; |
125 | 137 |
126 /* A node in a gimple_seq_d. */ | 138 /* A node in a gimple_seq_d. */ |
127 struct gimple_seq_node_d GTY((chain_next ("%h.next"), chain_prev ("%h.prev"))) | 139 struct GTY((chain_next ("%h.next"), chain_prev ("%h.prev"))) gimple_seq_node_d { |
128 { | |
129 gimple stmt; | 140 gimple stmt; |
130 struct gimple_seq_node_d *prev; | 141 struct gimple_seq_node_d *prev; |
131 struct gimple_seq_node_d *next; | 142 struct gimple_seq_node_d *next; |
132 }; | 143 }; |
133 | 144 |
134 /* A double-linked sequence of gimple statements. */ | 145 /* A double-linked sequence of gimple statements. */ |
135 struct gimple_seq_d GTY ((chain_next ("%h.next_free"))) | 146 struct GTY ((chain_next ("%h.next_free"))) gimple_seq_d { |
136 { | |
137 /* First and last statements in the sequence. */ | 147 /* First and last statements in the sequence. */ |
138 gimple_seq_node first; | 148 gimple_seq_node first; |
139 gimple_seq_node last; | 149 gimple_seq_node last; |
140 | 150 |
141 /* Sequences are created/destroyed frequently. To minimize | 151 /* Sequences are created/destroyed frequently. To minimize |
259 | 269 |
260 | 270 |
261 /* Data structure definitions for GIMPLE tuples. NOTE: word markers | 271 /* Data structure definitions for GIMPLE tuples. NOTE: word markers |
262 are for 64 bit hosts. */ | 272 are for 64 bit hosts. */ |
263 | 273 |
264 struct gimple_statement_base GTY(()) | 274 struct GTY(()) gimple_statement_base { |
265 { | |
266 /* [ WORD 1 ] | 275 /* [ WORD 1 ] |
267 Main identifying code for a tuple. */ | 276 Main identifying code for a tuple. */ |
268 ENUM_BITFIELD(gimple_code) code : 8; | 277 ENUM_BITFIELD(gimple_code) code : 8; |
269 | 278 |
270 /* Nonzero if a warning should not be emitted on this tuple. */ | 279 /* Nonzero if a warning should not be emitted on this tuple. */ |
289 unsigned modified : 1; | 298 unsigned modified : 1; |
290 | 299 |
291 /* Nonzero if this statement contains volatile operands. */ | 300 /* Nonzero if this statement contains volatile operands. */ |
292 unsigned has_volatile_ops : 1; | 301 unsigned has_volatile_ops : 1; |
293 | 302 |
294 /* Nonzero if this statement contains memory refernces. */ | 303 /* Padding to get subcode to 16 bit alignment. */ |
295 unsigned references_memory_p : 1; | 304 unsigned pad : 1; |
296 | 305 |
297 /* The SUBCODE field can be used for tuple-specific flags for tuples | 306 /* The SUBCODE field can be used for tuple-specific flags for tuples |
298 that do not require subcodes. Note that SUBCODE should be at | 307 that do not require subcodes. Note that SUBCODE should be at |
299 least as wide as tree codes, as several tuples store tree codes | 308 least as wide as tree codes, as several tuples store tree codes |
300 in there. */ | 309 in there. */ |
322 }; | 331 }; |
323 | 332 |
324 | 333 |
325 /* Base structure for tuples with operands. */ | 334 /* Base structure for tuples with operands. */ |
326 | 335 |
327 struct gimple_statement_with_ops_base GTY(()) | 336 struct GTY(()) gimple_statement_with_ops_base |
328 { | 337 { |
329 /* [ WORD 1-4 ] */ | 338 /* [ WORD 1-4 ] */ |
330 struct gimple_statement_base gsbase; | 339 struct gimple_statement_base gsbase; |
331 | 340 |
332 /* [ WORD 5 ] | 341 /* [ WORD 5-6 ] |
333 Symbols whose addresses are taken by this statement (i.e., they | |
334 appear inside ADDR_EXPR nodes). */ | |
335 bitmap GTY((skip (""))) addresses_taken; | |
336 | |
337 /* [ WORD 6-7 ] | |
338 SSA operand vectors. NOTE: It should be possible to | 342 SSA operand vectors. NOTE: It should be possible to |
339 amalgamate these vectors with the operand vector OP. However, | 343 amalgamate these vectors with the operand vector OP. However, |
340 the SSA operand vectors are organized differently and contain | 344 the SSA operand vectors are organized differently and contain |
341 more information (like immediate use chaining). */ | 345 more information (like immediate use chaining). */ |
342 struct def_optype_d GTY((skip (""))) *def_ops; | 346 struct def_optype_d GTY((skip (""))) *def_ops; |
344 }; | 348 }; |
345 | 349 |
346 | 350 |
347 /* Statements that take register operands. */ | 351 /* Statements that take register operands. */ |
348 | 352 |
349 struct gimple_statement_with_ops GTY(()) | 353 struct GTY(()) gimple_statement_with_ops |
350 { | 354 { |
351 /* [ WORD 1-7 ] */ | 355 /* [ WORD 1-6 ] */ |
352 struct gimple_statement_with_ops_base opbase; | 356 struct gimple_statement_with_ops_base opbase; |
353 | 357 |
354 /* [ WORD 8 ] | 358 /* [ WORD 7 ] |
355 Operand vector. NOTE! This must always be the last field | 359 Operand vector. NOTE! This must always be the last field |
356 of this structure. In particular, this means that this | 360 of this structure. In particular, this means that this |
357 structure cannot be embedded inside another one. */ | 361 structure cannot be embedded inside another one. */ |
358 tree GTY((length ("%h.opbase.gsbase.num_ops"))) op[1]; | 362 tree GTY((length ("%h.opbase.gsbase.num_ops"))) op[1]; |
359 }; | 363 }; |
360 | 364 |
361 | 365 |
362 /* Base for statements that take both memory and register operands. */ | 366 /* Base for statements that take both memory and register operands. */ |
363 | 367 |
364 struct gimple_statement_with_memory_ops_base GTY(()) | 368 struct GTY(()) gimple_statement_with_memory_ops_base |
365 { | 369 { |
366 /* [ WORD 1-7 ] */ | 370 /* [ WORD 1-6 ] */ |
367 struct gimple_statement_with_ops_base opbase; | 371 struct gimple_statement_with_ops_base opbase; |
368 | 372 |
369 /* [ WORD 8-9 ] | 373 /* [ WORD 7-8 ] |
370 Vectors for virtual operands. */ | 374 Virtual operands for this statement. The GC will pick them |
371 struct voptype_d GTY((skip (""))) *vdef_ops; | 375 up via the ssa_names array. */ |
372 struct voptype_d GTY((skip (""))) *vuse_ops; | 376 tree GTY((skip (""))) vdef; |
373 | 377 tree GTY((skip (""))) vuse; |
374 /* [ WORD 9-10 ] | |
375 Symbols stored/loaded by this statement. */ | |
376 bitmap GTY((skip (""))) stores; | |
377 bitmap GTY((skip (""))) loads; | |
378 }; | 378 }; |
379 | 379 |
380 | 380 |
381 /* Statements that take both memory and register operands. */ | 381 /* Statements that take both memory and register operands. */ |
382 | 382 |
383 struct gimple_statement_with_memory_ops GTY(()) | 383 struct GTY(()) gimple_statement_with_memory_ops |
384 { | 384 { |
385 /* [ WORD 1-10 ] */ | 385 /* [ WORD 1-8 ] */ |
386 struct gimple_statement_with_memory_ops_base membase; | 386 struct gimple_statement_with_memory_ops_base membase; |
387 | 387 |
388 /* [ WORD 11 ] | 388 /* [ WORD 9 ] |
389 Operand vector. NOTE! This must always be the last field | 389 Operand vector. NOTE! This must always be the last field |
390 of this structure. In particular, this means that this | 390 of this structure. In particular, this means that this |
391 structure cannot be embedded inside another one. */ | 391 structure cannot be embedded inside another one. */ |
392 tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1]; | 392 tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1]; |
393 }; | 393 }; |
394 | 394 |
395 | 395 |
396 /* OpenMP statements (#pragma omp). */ | 396 /* OpenMP statements (#pragma omp). */ |
397 | 397 |
398 struct gimple_statement_omp GTY(()) | 398 struct GTY(()) gimple_statement_omp { |
399 { | |
400 /* [ WORD 1-4 ] */ | 399 /* [ WORD 1-4 ] */ |
401 struct gimple_statement_base gsbase; | 400 struct gimple_statement_base gsbase; |
402 | 401 |
403 /* [ WORD 5 ] */ | 402 /* [ WORD 5 ] */ |
404 gimple_seq body; | 403 gimple_seq body; |
405 }; | 404 }; |
406 | 405 |
407 | 406 |
408 /* GIMPLE_BIND */ | 407 /* GIMPLE_BIND */ |
409 | 408 |
410 struct gimple_statement_bind GTY(()) | 409 struct GTY(()) gimple_statement_bind { |
411 { | |
412 /* [ WORD 1-4 ] */ | 410 /* [ WORD 1-4 ] */ |
413 struct gimple_statement_base gsbase; | 411 struct gimple_statement_base gsbase; |
414 | 412 |
415 /* [ WORD 5 ] | 413 /* [ WORD 5 ] |
416 Variables declared in this scope. */ | 414 Variables declared in this scope. */ |
429 }; | 427 }; |
430 | 428 |
431 | 429 |
432 /* GIMPLE_CATCH */ | 430 /* GIMPLE_CATCH */ |
433 | 431 |
434 struct gimple_statement_catch GTY(()) | 432 struct GTY(()) gimple_statement_catch { |
435 { | |
436 /* [ WORD 1-4 ] */ | 433 /* [ WORD 1-4 ] */ |
437 struct gimple_statement_base gsbase; | 434 struct gimple_statement_base gsbase; |
438 | 435 |
439 /* [ WORD 5 ] */ | 436 /* [ WORD 5 ] */ |
440 tree types; | 437 tree types; |
444 }; | 441 }; |
445 | 442 |
446 | 443 |
447 /* GIMPLE_EH_FILTER */ | 444 /* GIMPLE_EH_FILTER */ |
448 | 445 |
449 struct gimple_statement_eh_filter GTY(()) | 446 struct GTY(()) gimple_statement_eh_filter { |
450 { | |
451 /* [ WORD 1-4 ] */ | 447 /* [ WORD 1-4 ] */ |
452 struct gimple_statement_base gsbase; | 448 struct gimple_statement_base gsbase; |
453 | |
454 /* Subcode: EH_FILTER_MUST_NOT_THROW. A boolean flag analogous to | |
455 the tree counterpart. */ | |
456 | 449 |
457 /* [ WORD 5 ] | 450 /* [ WORD 5 ] |
458 Filter types. */ | 451 Filter types. */ |
459 tree types; | 452 tree types; |
460 | 453 |
462 Failure actions. */ | 455 Failure actions. */ |
463 gimple_seq failure; | 456 gimple_seq failure; |
464 }; | 457 }; |
465 | 458 |
466 | 459 |
460 /* GIMPLE_EH_MUST_NOT_THROW */ | |
461 | |
462 struct GTY(()) gimple_statement_eh_mnt { | |
463 /* [ WORD 1-4 ] */ | |
464 struct gimple_statement_base gsbase; | |
465 | |
466 /* [ WORD 5 ] Abort function decl. */ | |
467 tree fndecl; | |
468 }; | |
469 | |
467 /* GIMPLE_PHI */ | 470 /* GIMPLE_PHI */ |
468 | 471 |
469 struct gimple_statement_phi GTY(()) | 472 struct GTY(()) gimple_statement_phi { |
470 { | |
471 /* [ WORD 1-4 ] */ | 473 /* [ WORD 1-4 ] */ |
472 struct gimple_statement_base gsbase; | 474 struct gimple_statement_base gsbase; |
473 | 475 |
474 /* [ WORD 5 ] */ | 476 /* [ WORD 5 ] */ |
475 unsigned capacity; | 477 unsigned capacity; |
481 /* [ WORD 7 ] */ | 483 /* [ WORD 7 ] */ |
482 struct phi_arg_d GTY ((length ("%h.nargs"))) args[1]; | 484 struct phi_arg_d GTY ((length ("%h.nargs"))) args[1]; |
483 }; | 485 }; |
484 | 486 |
485 | 487 |
486 /* GIMPLE_RESX */ | 488 /* GIMPLE_RESX, GIMPLE_EH_DISPATCH */ |
487 | 489 |
488 struct gimple_statement_resx GTY(()) | 490 struct GTY(()) gimple_statement_eh_ctrl |
489 { | 491 { |
490 /* [ WORD 1-4 ] */ | 492 /* [ WORD 1-4 ] */ |
491 struct gimple_statement_base gsbase; | 493 struct gimple_statement_base gsbase; |
492 | 494 |
493 /* [ WORD 5 ] | 495 /* [ WORD 5 ] |
496 }; | 498 }; |
497 | 499 |
498 | 500 |
499 /* GIMPLE_TRY */ | 501 /* GIMPLE_TRY */ |
500 | 502 |
501 struct gimple_statement_try GTY(()) | 503 struct GTY(()) gimple_statement_try { |
502 { | |
503 /* [ WORD 1-4 ] */ | 504 /* [ WORD 1-4 ] */ |
504 struct gimple_statement_base gsbase; | 505 struct gimple_statement_base gsbase; |
505 | 506 |
506 /* [ WORD 5 ] | 507 /* [ WORD 5 ] |
507 Expression to evaluate. */ | 508 Expression to evaluate. */ |
526 GIMPLE_TRY_CATCH_IS_CLEANUP = 1 << 2 | 527 GIMPLE_TRY_CATCH_IS_CLEANUP = 1 << 2 |
527 }; | 528 }; |
528 | 529 |
529 /* GIMPLE_WITH_CLEANUP_EXPR */ | 530 /* GIMPLE_WITH_CLEANUP_EXPR */ |
530 | 531 |
531 struct gimple_statement_wce GTY(()) | 532 struct GTY(()) gimple_statement_wce { |
532 { | |
533 /* [ WORD 1-4 ] */ | 533 /* [ WORD 1-4 ] */ |
534 struct gimple_statement_base gsbase; | 534 struct gimple_statement_base gsbase; |
535 | 535 |
536 /* Subcode: CLEANUP_EH_ONLY. True if the cleanup should only be | 536 /* Subcode: CLEANUP_EH_ONLY. True if the cleanup should only be |
537 executed if an exception is thrown, not on normal exit of its | 537 executed if an exception is thrown, not on normal exit of its |
544 }; | 544 }; |
545 | 545 |
546 | 546 |
547 /* GIMPLE_ASM */ | 547 /* GIMPLE_ASM */ |
548 | 548 |
549 struct gimple_statement_asm GTY(()) | 549 struct GTY(()) gimple_statement_asm |
550 { | 550 { |
551 /* [ WORD 1-10 ] */ | 551 /* [ WORD 1-8 ] */ |
552 struct gimple_statement_with_memory_ops_base membase; | 552 struct gimple_statement_with_memory_ops_base membase; |
553 | 553 |
554 /* [ WORD 11 ] | 554 /* [ WORD 9 ] |
555 __asm__ statement. */ | 555 __asm__ statement. */ |
556 const char *string; | 556 const char *string; |
557 | 557 |
558 /* [ WORD 12 ] | 558 /* [ WORD 10 ] |
559 Number of inputs, outputs and clobbers. */ | 559 Number of inputs, outputs, clobbers, labels. */ |
560 unsigned char ni; | 560 unsigned char ni; |
561 unsigned char no; | 561 unsigned char no; |
562 unsigned short nc; | 562 unsigned char nc; |
563 | 563 unsigned char nl; |
564 /* [ WORD 13 ] | 564 |
565 /* [ WORD 11 ] | |
565 Operand vector. NOTE! This must always be the last field | 566 Operand vector. NOTE! This must always be the last field |
566 of this structure. In particular, this means that this | 567 of this structure. In particular, this means that this |
567 structure cannot be embedded inside another one. */ | 568 structure cannot be embedded inside another one. */ |
568 tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1]; | 569 tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1]; |
569 }; | 570 }; |
570 | 571 |
571 /* GIMPLE_OMP_CRITICAL */ | 572 /* GIMPLE_OMP_CRITICAL */ |
572 | 573 |
573 struct gimple_statement_omp_critical GTY(()) | 574 struct GTY(()) gimple_statement_omp_critical { |
574 { | |
575 /* [ WORD 1-5 ] */ | 575 /* [ WORD 1-5 ] */ |
576 struct gimple_statement_omp omp; | 576 struct gimple_statement_omp omp; |
577 | 577 |
578 /* [ WORD 6 ] | 578 /* [ WORD 6 ] |
579 Critical section name. */ | 579 Critical section name. */ |
580 tree name; | 580 tree name; |
581 }; | 581 }; |
582 | 582 |
583 | 583 |
584 struct gimple_omp_for_iter GTY(()) | 584 struct GTY(()) gimple_omp_for_iter { |
585 { | |
586 /* Condition code. */ | 585 /* Condition code. */ |
587 enum tree_code cond; | 586 enum tree_code cond; |
588 | 587 |
589 /* Index variable. */ | 588 /* Index variable. */ |
590 tree index; | 589 tree index; |
591 | 590 |
592 /* Initial value. */ | 591 /* Initial value. */ |
593 tree initial; | 592 tree initial; |
594 | 593 |
595 /* Final value. */ | 594 /* Final value. */ |
596 tree final; | 595 tree final; |
597 | 596 |
598 /* Increment. */ | 597 /* Increment. */ |
599 tree incr; | 598 tree incr; |
600 }; | 599 }; |
601 | 600 |
602 /* GIMPLE_OMP_FOR */ | 601 /* GIMPLE_OMP_FOR */ |
603 | 602 |
604 struct gimple_statement_omp_for GTY(()) | 603 struct GTY(()) gimple_statement_omp_for { |
605 { | |
606 /* [ WORD 1-5 ] */ | 604 /* [ WORD 1-5 ] */ |
607 struct gimple_statement_omp omp; | 605 struct gimple_statement_omp omp; |
608 | 606 |
609 /* [ WORD 6 ] */ | 607 /* [ WORD 6 ] */ |
610 tree clauses; | 608 tree clauses; |
622 }; | 620 }; |
623 | 621 |
624 | 622 |
625 /* GIMPLE_OMP_PARALLEL */ | 623 /* GIMPLE_OMP_PARALLEL */ |
626 | 624 |
627 struct gimple_statement_omp_parallel GTY(()) | 625 struct GTY(()) gimple_statement_omp_parallel { |
628 { | |
629 /* [ WORD 1-5 ] */ | 626 /* [ WORD 1-5 ] */ |
630 struct gimple_statement_omp omp; | 627 struct gimple_statement_omp omp; |
631 | 628 |
632 /* [ WORD 6 ] | 629 /* [ WORD 6 ] |
633 Clauses. */ | 630 Clauses. */ |
643 }; | 640 }; |
644 | 641 |
645 | 642 |
646 /* GIMPLE_OMP_TASK */ | 643 /* GIMPLE_OMP_TASK */ |
647 | 644 |
648 struct gimple_statement_omp_task GTY(()) | 645 struct GTY(()) gimple_statement_omp_task { |
649 { | |
650 /* [ WORD 1-8 ] */ | 646 /* [ WORD 1-8 ] */ |
651 struct gimple_statement_omp_parallel par; | 647 struct gimple_statement_omp_parallel par; |
652 | 648 |
653 /* [ WORD 9 ] | 649 /* [ WORD 9 ] |
654 Child function holding firstprivate initialization if needed. */ | 650 Child function holding firstprivate initialization if needed. */ |
665 /* Uses struct gimple_statement_omp. */ | 661 /* Uses struct gimple_statement_omp. */ |
666 | 662 |
667 | 663 |
668 /* GIMPLE_OMP_SECTIONS */ | 664 /* GIMPLE_OMP_SECTIONS */ |
669 | 665 |
670 struct gimple_statement_omp_sections GTY(()) | 666 struct GTY(()) gimple_statement_omp_sections { |
671 { | |
672 /* [ WORD 1-5 ] */ | 667 /* [ WORD 1-5 ] */ |
673 struct gimple_statement_omp omp; | 668 struct gimple_statement_omp omp; |
674 | 669 |
675 /* [ WORD 6 ] */ | 670 /* [ WORD 6 ] */ |
676 tree clauses; | 671 tree clauses; |
684 /* GIMPLE_OMP_CONTINUE. | 679 /* GIMPLE_OMP_CONTINUE. |
685 | 680 |
686 Note: This does not inherit from gimple_statement_omp, because we | 681 Note: This does not inherit from gimple_statement_omp, because we |
687 do not need the body field. */ | 682 do not need the body field. */ |
688 | 683 |
689 struct gimple_statement_omp_continue GTY(()) | 684 struct GTY(()) gimple_statement_omp_continue { |
690 { | |
691 /* [ WORD 1-4 ] */ | 685 /* [ WORD 1-4 ] */ |
692 struct gimple_statement_base gsbase; | 686 struct gimple_statement_base gsbase; |
693 | 687 |
694 /* [ WORD 5 ] */ | 688 /* [ WORD 5 ] */ |
695 tree control_def; | 689 tree control_def; |
698 tree control_use; | 692 tree control_use; |
699 }; | 693 }; |
700 | 694 |
701 /* GIMPLE_OMP_SINGLE */ | 695 /* GIMPLE_OMP_SINGLE */ |
702 | 696 |
703 struct gimple_statement_omp_single GTY(()) | 697 struct GTY(()) gimple_statement_omp_single { |
704 { | |
705 /* [ WORD 1-5 ] */ | 698 /* [ WORD 1-5 ] */ |
706 struct gimple_statement_omp omp; | 699 struct gimple_statement_omp omp; |
707 | 700 |
708 /* [ WORD 6 ] */ | 701 /* [ WORD 6 ] */ |
709 tree clauses; | 702 tree clauses; |
710 }; | 703 }; |
711 | 704 |
712 | 705 |
713 /* GIMPLE_OMP_ATOMIC_LOAD. | 706 /* GIMPLE_OMP_ATOMIC_LOAD. |
714 Note: This is based on gimple_statement_base, not g_s_omp, because g_s_omp | 707 Note: This is based on gimple_statement_base, not g_s_omp, because g_s_omp |
715 contains a sequence, which we don't need here. */ | 708 contains a sequence, which we don't need here. */ |
716 | 709 |
717 struct gimple_statement_omp_atomic_load GTY(()) | 710 struct GTY(()) gimple_statement_omp_atomic_load { |
718 { | |
719 /* [ WORD 1-4 ] */ | 711 /* [ WORD 1-4 ] */ |
720 struct gimple_statement_base gsbase; | 712 struct gimple_statement_base gsbase; |
721 | 713 |
722 /* [ WORD 5-6 ] */ | 714 /* [ WORD 5-6 ] */ |
723 tree rhs, lhs; | 715 tree rhs, lhs; |
724 }; | 716 }; |
725 | 717 |
726 /* GIMPLE_OMP_ATOMIC_STORE. | 718 /* GIMPLE_OMP_ATOMIC_STORE. |
727 See note on GIMPLE_OMP_ATOMIC_LOAD. */ | 719 See note on GIMPLE_OMP_ATOMIC_LOAD. */ |
728 | 720 |
729 struct gimple_statement_omp_atomic_store GTY(()) | 721 struct GTY(()) gimple_statement_omp_atomic_store { |
730 { | |
731 /* [ WORD 1-4 ] */ | 722 /* [ WORD 1-4 ] */ |
732 struct gimple_statement_base gsbase; | 723 struct gimple_statement_base gsbase; |
733 | 724 |
734 /* [ WORD 5 ] */ | 725 /* [ WORD 5 ] */ |
735 tree val; | 726 tree val; |
736 }; | 727 }; |
737 | 728 |
729 #define DEFGSSTRUCT(SYM, STRUCT, HAS_TREE_OP) SYM, | |
738 enum gimple_statement_structure_enum { | 730 enum gimple_statement_structure_enum { |
739 #define DEFGSSTRUCT(SYM, STRING) SYM, | |
740 #include "gsstruct.def" | 731 #include "gsstruct.def" |
741 #undef DEFGSSTRUCT | |
742 LAST_GSS_ENUM | 732 LAST_GSS_ENUM |
743 }; | 733 }; |
734 #undef DEFGSSTRUCT | |
744 | 735 |
745 | 736 |
746 /* Define the overall contents of a gimple tuple. It may be any of the | 737 /* Define the overall contents of a gimple tuple. It may be any of the |
747 structures declared above for various types of tuples. */ | 738 structures declared above for various types of tuples. */ |
748 | 739 |
749 union gimple_statement_d GTY ((desc ("gimple_statement_structure (&%h)"))) | 740 union GTY ((desc ("gimple_statement_structure (&%h)"))) gimple_statement_d { |
750 { | |
751 struct gimple_statement_base GTY ((tag ("GSS_BASE"))) gsbase; | 741 struct gimple_statement_base GTY ((tag ("GSS_BASE"))) gsbase; |
752 struct gimple_statement_with_ops GTY ((tag ("GSS_WITH_OPS"))) gsops; | 742 struct gimple_statement_with_ops GTY ((tag ("GSS_WITH_OPS"))) gsops; |
743 struct gimple_statement_with_memory_ops_base GTY ((tag ("GSS_WITH_MEM_OPS_BASE"))) gsmembase; | |
753 struct gimple_statement_with_memory_ops GTY ((tag ("GSS_WITH_MEM_OPS"))) gsmem; | 744 struct gimple_statement_with_memory_ops GTY ((tag ("GSS_WITH_MEM_OPS"))) gsmem; |
754 struct gimple_statement_omp GTY ((tag ("GSS_OMP"))) omp; | 745 struct gimple_statement_omp GTY ((tag ("GSS_OMP"))) omp; |
755 struct gimple_statement_bind GTY ((tag ("GSS_BIND"))) gimple_bind; | 746 struct gimple_statement_bind GTY ((tag ("GSS_BIND"))) gimple_bind; |
756 struct gimple_statement_catch GTY ((tag ("GSS_CATCH"))) gimple_catch; | 747 struct gimple_statement_catch GTY ((tag ("GSS_CATCH"))) gimple_catch; |
757 struct gimple_statement_eh_filter GTY ((tag ("GSS_EH_FILTER"))) gimple_eh_filter; | 748 struct gimple_statement_eh_filter GTY ((tag ("GSS_EH_FILTER"))) gimple_eh_filter; |
749 struct gimple_statement_eh_mnt GTY ((tag ("GSS_EH_MNT"))) gimple_eh_mnt; | |
758 struct gimple_statement_phi GTY ((tag ("GSS_PHI"))) gimple_phi; | 750 struct gimple_statement_phi GTY ((tag ("GSS_PHI"))) gimple_phi; |
759 struct gimple_statement_resx GTY ((tag ("GSS_RESX"))) gimple_resx; | 751 struct gimple_statement_eh_ctrl GTY ((tag ("GSS_EH_CTRL"))) gimple_eh_ctrl; |
760 struct gimple_statement_try GTY ((tag ("GSS_TRY"))) gimple_try; | 752 struct gimple_statement_try GTY ((tag ("GSS_TRY"))) gimple_try; |
761 struct gimple_statement_wce GTY ((tag ("GSS_WCE"))) gimple_wce; | 753 struct gimple_statement_wce GTY ((tag ("GSS_WCE"))) gimple_wce; |
762 struct gimple_statement_asm GTY ((tag ("GSS_ASM"))) gimple_asm; | 754 struct gimple_statement_asm GTY ((tag ("GSS_ASM"))) gimple_asm; |
763 struct gimple_statement_omp_critical GTY ((tag ("GSS_OMP_CRITICAL"))) gimple_omp_critical; | 755 struct gimple_statement_omp_critical GTY ((tag ("GSS_OMP_CRITICAL"))) gimple_omp_critical; |
764 struct gimple_statement_omp_for GTY ((tag ("GSS_OMP_FOR"))) gimple_omp_for; | 756 struct gimple_statement_omp_for GTY ((tag ("GSS_OMP_FOR"))) gimple_omp_for; |
770 struct gimple_statement_omp_atomic_load GTY ((tag ("GSS_OMP_ATOMIC_LOAD"))) gimple_omp_atomic_load; | 762 struct gimple_statement_omp_atomic_load GTY ((tag ("GSS_OMP_ATOMIC_LOAD"))) gimple_omp_atomic_load; |
771 struct gimple_statement_omp_atomic_store GTY ((tag ("GSS_OMP_ATOMIC_STORE"))) gimple_omp_atomic_store; | 763 struct gimple_statement_omp_atomic_store GTY ((tag ("GSS_OMP_ATOMIC_STORE"))) gimple_omp_atomic_store; |
772 }; | 764 }; |
773 | 765 |
774 /* In gimple.c. */ | 766 /* In gimple.c. */ |
767 | |
768 /* Offset in bytes to the location of the operand vector. | |
769 Zero if there is no operand vector for this tuple structure. */ | |
770 extern size_t const gimple_ops_offset_[]; | |
771 | |
772 /* Map GIMPLE codes to GSS codes. */ | |
773 extern enum gimple_statement_structure_enum const gss_for_code_[]; | |
774 | |
775 /* This variable holds the currently expanded gimple statement for purposes | |
776 of comminucating the profile info to the builtin expanders. */ | |
777 extern gimple currently_expanding_gimple_stmt; | |
778 | |
775 gimple gimple_build_return (tree); | 779 gimple gimple_build_return (tree); |
776 | 780 |
777 gimple gimple_build_assign_stat (tree, tree MEM_STAT_DECL); | 781 gimple gimple_build_assign_stat (tree, tree MEM_STAT_DECL); |
778 #define gimple_build_assign(l,r) gimple_build_assign_stat (l, r MEM_STAT_INFO) | 782 #define gimple_build_assign(l,r) gimple_build_assign_stat (l, r MEM_STAT_INFO) |
779 | 783 |
781 | 785 |
782 gimple gimple_build_assign_with_ops_stat (enum tree_code, tree, tree, | 786 gimple gimple_build_assign_with_ops_stat (enum tree_code, tree, tree, |
783 tree MEM_STAT_DECL); | 787 tree MEM_STAT_DECL); |
784 #define gimple_build_assign_with_ops(c,o1,o2,o3) \ | 788 #define gimple_build_assign_with_ops(c,o1,o2,o3) \ |
785 gimple_build_assign_with_ops_stat (c, o1, o2, o3 MEM_STAT_INFO) | 789 gimple_build_assign_with_ops_stat (c, o1, o2, o3 MEM_STAT_INFO) |
790 | |
791 gimple gimple_build_debug_bind_stat (tree, tree, gimple MEM_STAT_DECL); | |
792 #define gimple_build_debug_bind(var,val,stmt) \ | |
793 gimple_build_debug_bind_stat ((var), (val), (stmt) MEM_STAT_INFO) | |
786 | 794 |
787 gimple gimple_build_call_vec (tree, VEC(tree, heap) *); | 795 gimple gimple_build_call_vec (tree, VEC(tree, heap) *); |
788 gimple gimple_build_call (tree, unsigned, ...); | 796 gimple gimple_build_call (tree, unsigned, ...); |
789 gimple gimple_build_call_from_tree (tree); | 797 gimple gimple_build_call_from_tree (tree); |
790 gimple gimplify_assign (tree, tree, gimple_seq *); | 798 gimple gimplify_assign (tree, tree, gimple_seq *); |
791 gimple gimple_build_cond (enum tree_code, tree, tree, tree, tree); | 799 gimple gimple_build_cond (enum tree_code, tree, tree, tree, tree); |
792 gimple gimple_build_label (tree label); | 800 gimple gimple_build_label (tree label); |
793 gimple gimple_build_goto (tree dest); | 801 gimple gimple_build_goto (tree dest); |
794 gimple gimple_build_nop (void); | 802 gimple gimple_build_nop (void); |
795 gimple gimple_build_bind (tree, gimple_seq, tree); | 803 gimple gimple_build_bind (tree, gimple_seq, tree); |
796 gimple gimple_build_asm (const char *, unsigned, unsigned, unsigned, ...); | |
797 gimple gimple_build_asm_vec (const char *, VEC(tree,gc) *, VEC(tree,gc) *, | 804 gimple gimple_build_asm_vec (const char *, VEC(tree,gc) *, VEC(tree,gc) *, |
798 VEC(tree,gc) *); | 805 VEC(tree,gc) *, VEC(tree,gc) *); |
799 gimple gimple_build_catch (tree, gimple_seq); | 806 gimple gimple_build_catch (tree, gimple_seq); |
800 gimple gimple_build_eh_filter (tree, gimple_seq); | 807 gimple gimple_build_eh_filter (tree, gimple_seq); |
808 gimple gimple_build_eh_must_not_throw (tree); | |
801 gimple gimple_build_try (gimple_seq, gimple_seq, enum gimple_try_flags); | 809 gimple gimple_build_try (gimple_seq, gimple_seq, enum gimple_try_flags); |
802 gimple gimple_build_wce (gimple_seq); | 810 gimple gimple_build_wce (gimple_seq); |
803 gimple gimple_build_resx (int); | 811 gimple gimple_build_resx (int); |
812 gimple gimple_build_eh_dispatch (int); | |
813 gimple gimple_build_switch_nlabels (unsigned, tree, tree); | |
804 gimple gimple_build_switch (unsigned, tree, tree, ...); | 814 gimple gimple_build_switch (unsigned, tree, tree, ...); |
805 gimple gimple_build_switch_vec (tree, tree, VEC(tree,heap) *); | 815 gimple gimple_build_switch_vec (tree, tree, VEC(tree,heap) *); |
806 gimple gimple_build_omp_parallel (gimple_seq, tree, tree, tree); | 816 gimple gimple_build_omp_parallel (gimple_seq, tree, tree, tree); |
807 gimple gimple_build_omp_task (gimple_seq, tree, tree, tree, tree, tree, tree); | 817 gimple gimple_build_omp_task (gimple_seq, tree, tree, tree, tree, tree, tree); |
808 gimple gimple_build_omp_for (gimple_seq, tree, size_t, gimple_seq); | 818 gimple gimple_build_omp_for (gimple_seq, tree, size_t, gimple_seq); |
817 gimple gimple_build_omp_single (gimple_seq, tree); | 827 gimple gimple_build_omp_single (gimple_seq, tree); |
818 gimple gimple_build_cdt (tree, tree); | 828 gimple gimple_build_cdt (tree, tree); |
819 gimple gimple_build_omp_atomic_load (tree, tree); | 829 gimple gimple_build_omp_atomic_load (tree, tree); |
820 gimple gimple_build_omp_atomic_store (tree); | 830 gimple gimple_build_omp_atomic_store (tree); |
821 gimple gimple_build_predict (enum br_predictor, enum prediction); | 831 gimple gimple_build_predict (enum br_predictor, enum prediction); |
822 enum gimple_statement_structure_enum gimple_statement_structure (gimple); | |
823 enum gimple_statement_structure_enum gss_for_assign (enum tree_code); | 832 enum gimple_statement_structure_enum gss_for_assign (enum tree_code); |
824 void sort_case_labels (VEC(tree,heap) *); | 833 void sort_case_labels (VEC(tree,heap) *); |
825 void gimple_set_body (tree, gimple_seq); | 834 void gimple_set_body (tree, gimple_seq); |
826 gimple_seq gimple_body (tree); | 835 gimple_seq gimple_body (tree); |
827 bool gimple_has_body_p (tree); | 836 bool gimple_has_body_p (tree); |
839 void gimple_assign_set_rhs_from_tree (gimple_stmt_iterator *, tree); | 848 void gimple_assign_set_rhs_from_tree (gimple_stmt_iterator *, tree); |
840 void gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *, enum tree_code, | 849 void gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *, enum tree_code, |
841 tree, tree); | 850 tree, tree); |
842 tree gimple_get_lhs (const_gimple); | 851 tree gimple_get_lhs (const_gimple); |
843 void gimple_set_lhs (gimple, tree); | 852 void gimple_set_lhs (gimple, tree); |
853 void gimple_replace_lhs (gimple, tree); | |
844 gimple gimple_copy (gimple); | 854 gimple gimple_copy (gimple); |
845 bool is_gimple_operand (const_tree); | 855 bool is_gimple_operand (const_tree); |
846 void gimple_set_modified (gimple, bool); | 856 void gimple_set_modified (gimple, bool); |
847 void gimple_cond_get_ops_from_tree (tree, enum tree_code *, tree *, tree *); | 857 void gimple_cond_get_ops_from_tree (tree, enum tree_code *, tree *, tree *); |
848 gimple gimple_build_cond_from_tree (tree, tree, tree); | 858 gimple gimple_build_cond_from_tree (tree, tree, tree); |
852 bool gimple_could_trap_p (gimple); | 862 bool gimple_could_trap_p (gimple); |
853 bool gimple_assign_rhs_could_trap_p (gimple); | 863 bool gimple_assign_rhs_could_trap_p (gimple); |
854 void gimple_regimplify_operands (gimple, gimple_stmt_iterator *); | 864 void gimple_regimplify_operands (gimple, gimple_stmt_iterator *); |
855 bool empty_body_p (gimple_seq); | 865 bool empty_body_p (gimple_seq); |
856 unsigned get_gimple_rhs_num_ops (enum tree_code); | 866 unsigned get_gimple_rhs_num_ops (enum tree_code); |
867 #define gimple_alloc(c, n) gimple_alloc_stat (c, n MEM_STAT_INFO) | |
868 gimple gimple_alloc_stat (enum gimple_code, unsigned MEM_STAT_DECL); | |
869 const char *gimple_decl_printable_name (tree, int); | |
870 tree gimple_fold_obj_type_ref (tree, tree); | |
857 | 871 |
858 /* Returns true iff T is a valid GIMPLE statement. */ | 872 /* Returns true iff T is a valid GIMPLE statement. */ |
859 extern bool is_gimple_stmt (tree); | 873 extern bool is_gimple_stmt (tree); |
860 | 874 |
861 /* Returns true iff TYPE is a valid type for a scalar register variable. */ | 875 /* Returns true iff TYPE is a valid type for a scalar register variable. */ |
862 extern bool is_gimple_reg_type (tree); | 876 extern bool is_gimple_reg_type (tree); |
863 /* Returns true iff T is a scalar register variable. */ | 877 /* Returns true iff T is a scalar register variable. */ |
864 extern bool is_gimple_reg (tree); | 878 extern bool is_gimple_reg (tree); |
865 /* Returns true if T is a GIMPLE temporary variable, false otherwise. */ | |
866 extern bool is_gimple_formal_tmp_var (tree); | |
867 /* Returns true if T is a GIMPLE temporary register variable. */ | |
868 extern bool is_gimple_formal_tmp_reg (tree); | |
869 /* Returns true iff T is any sort of variable. */ | 879 /* Returns true iff T is any sort of variable. */ |
870 extern bool is_gimple_variable (tree); | 880 extern bool is_gimple_variable (tree); |
871 /* Returns true iff T is any sort of symbol. */ | 881 /* Returns true iff T is any sort of symbol. */ |
872 extern bool is_gimple_id (tree); | 882 extern bool is_gimple_id (tree); |
873 /* Returns true iff T is a variable or an INDIRECT_REF (of a variable). */ | 883 /* Returns true iff T is a variable or an INDIRECT_REF (of a variable). */ |
895 /* Returns true iff T is a GIMPLE asm statement input. */ | 905 /* Returns true iff T is a GIMPLE asm statement input. */ |
896 extern bool is_gimple_asm_val (tree); | 906 extern bool is_gimple_asm_val (tree); |
897 /* Returns true iff T is a valid rhs for a MODIFY_EXPR where the LHS is a | 907 /* Returns true iff T is a valid rhs for a MODIFY_EXPR where the LHS is a |
898 GIMPLE temporary, a renamed user variable, or something else, | 908 GIMPLE temporary, a renamed user variable, or something else, |
899 respectively. */ | 909 respectively. */ |
900 extern bool is_gimple_formal_tmp_rhs (tree); | |
901 extern bool is_gimple_reg_rhs (tree); | 910 extern bool is_gimple_reg_rhs (tree); |
902 extern bool is_gimple_mem_rhs (tree); | 911 extern bool is_gimple_mem_rhs (tree); |
903 | 912 |
904 /* Returns true iff T is a valid if-statement condition. */ | 913 /* Returns true iff T is a valid if-statement condition. */ |
905 extern bool is_gimple_condexpr (tree); | 914 extern bool is_gimple_condexpr (tree); |
913 extern bool is_gimple_call_addr (tree); | 922 extern bool is_gimple_call_addr (tree); |
914 /* If T makes a function call, returns the CALL_EXPR operand. */ | 923 /* If T makes a function call, returns the CALL_EXPR operand. */ |
915 extern tree get_call_expr_in (tree t); | 924 extern tree get_call_expr_in (tree t); |
916 | 925 |
917 extern void recalculate_side_effects (tree); | 926 extern void recalculate_side_effects (tree); |
927 extern bool compare_field_offset (tree, tree); | |
928 extern tree gimple_register_type (tree); | |
929 extern void print_gimple_types_stats (void); | |
930 extern void free_gimple_type_tables (void); | |
931 extern tree gimple_unsigned_type (tree); | |
932 extern tree gimple_signed_type (tree); | |
933 extern alias_set_type gimple_get_alias_set (tree); | |
934 extern void count_uses_and_derefs (tree, gimple, unsigned *, unsigned *, | |
935 unsigned *); | |
936 extern bool walk_stmt_load_store_addr_ops (gimple, void *, | |
937 bool (*)(gimple, tree, void *), | |
938 bool (*)(gimple, tree, void *), | |
939 bool (*)(gimple, tree, void *)); | |
940 extern bool walk_stmt_load_store_ops (gimple, void *, | |
941 bool (*)(gimple, tree, void *), | |
942 bool (*)(gimple, tree, void *)); | |
943 extern bool gimple_ior_addresses_taken (bitmap, gimple); | |
918 | 944 |
919 /* In gimplify.c */ | 945 /* In gimplify.c */ |
920 extern tree create_tmp_var_raw (tree, const char *); | 946 extern tree create_tmp_var_raw (tree, const char *); |
921 extern tree create_tmp_var_name (const char *); | 947 extern tree create_tmp_var_name (const char *); |
922 extern tree create_tmp_var (tree, const char *); | 948 extern tree create_tmp_var (tree, const char *); |
923 extern tree get_initialized_tmp_var (tree, gimple_seq *, gimple_seq *); | 949 extern tree get_initialized_tmp_var (tree, gimple_seq *, gimple_seq *); |
924 extern tree get_formal_tmp_var (tree, gimple_seq *); | 950 extern tree get_formal_tmp_var (tree, gimple_seq *); |
925 extern void declare_vars (tree, gimple, bool); | 951 extern void declare_vars (tree, gimple, bool); |
926 extern void tree_annotate_all_with_location (tree *, location_t); | |
927 extern void annotate_all_with_location (gimple_seq, location_t); | 952 extern void annotate_all_with_location (gimple_seq, location_t); |
928 | 953 |
929 /* Validation of GIMPLE expressions. Note that these predicates only check | 954 /* Validation of GIMPLE expressions. Note that these predicates only check |
930 the basic form of the expression, they don't recurse to make sure that | 955 the basic form of the expression, they don't recurse to make sure that |
931 underlying nodes are also of the right form. */ | 956 underlying nodes are also of the right form. */ |
932 typedef bool (*gimple_predicate)(tree); | 957 typedef bool (*gimple_predicate)(tree); |
933 | 958 |
934 | 959 |
935 /* FIXME we should deduce this from the predicate. */ | 960 /* FIXME we should deduce this from the predicate. */ |
936 typedef enum fallback_t { | 961 enum fallback { |
937 fb_none = 0, /* Do not generate a temporary. */ | 962 fb_none = 0, /* Do not generate a temporary. */ |
938 | 963 |
939 fb_rvalue = 1, /* Generate an rvalue to hold the result of a | 964 fb_rvalue = 1, /* Generate an rvalue to hold the result of a |
940 gimplified expression. */ | 965 gimplified expression. */ |
941 | 966 |
943 gimplified expression. */ | 968 gimplified expression. */ |
944 | 969 |
945 fb_mayfail = 4, /* Gimplification may fail. Error issued | 970 fb_mayfail = 4, /* Gimplification may fail. Error issued |
946 afterwards. */ | 971 afterwards. */ |
947 fb_either= fb_rvalue | fb_lvalue | 972 fb_either= fb_rvalue | fb_lvalue |
948 } fallback_t; | 973 }; |
974 | |
975 typedef int fallback_t; | |
949 | 976 |
950 enum gimplify_status { | 977 enum gimplify_status { |
951 GS_ERROR = -2, /* Something Bad Seen. */ | 978 GS_ERROR = -2, /* Something Bad Seen. */ |
952 GS_UNHANDLED = -1, /* A langhook result for "I dunno". */ | 979 GS_UNHANDLED = -1, /* A langhook result for "I dunno". */ |
953 GS_OK = 0, /* We did something, maybe more to do. */ | 980 GS_OK = 0, /* We did something, maybe more to do. */ |
961 VEC(gimple,heap) *bind_expr_stack; | 988 VEC(gimple,heap) *bind_expr_stack; |
962 tree temps; | 989 tree temps; |
963 gimple_seq conditional_cleanups; | 990 gimple_seq conditional_cleanups; |
964 tree exit_label; | 991 tree exit_label; |
965 tree return_temp; | 992 tree return_temp; |
966 | 993 |
967 VEC(tree,heap) *case_labels; | 994 VEC(tree,heap) *case_labels; |
968 /* The formal temporary table. Should this be persistent? */ | 995 /* The formal temporary table. Should this be persistent? */ |
969 htab_t temp_htab; | 996 htab_t temp_htab; |
970 | 997 |
971 int conditions; | 998 int conditions; |
1000 extern tree gimple_boolify (tree); | 1027 extern tree gimple_boolify (tree); |
1001 extern gimple_predicate rhs_predicate_for (tree); | 1028 extern gimple_predicate rhs_predicate_for (tree); |
1002 extern tree canonicalize_cond_expr_cond (tree); | 1029 extern tree canonicalize_cond_expr_cond (tree); |
1003 | 1030 |
1004 /* In omp-low.c. */ | 1031 /* In omp-low.c. */ |
1005 extern void diagnose_omp_structured_block_errors (tree); | |
1006 extern tree omp_reduction_init (tree, tree); | 1032 extern tree omp_reduction_init (tree, tree); |
1007 | 1033 |
1008 /* In tree-nested.c. */ | 1034 /* In tree-nested.c. */ |
1009 extern void lower_nested_functions (tree); | 1035 extern void lower_nested_functions (tree); |
1010 extern void insert_field_into_struct (tree, tree); | 1036 extern void insert_field_into_struct (tree, tree); |
1016 extern tree gimple_assign_rhs_to_tree (gimple); | 1042 extern tree gimple_assign_rhs_to_tree (gimple); |
1017 | 1043 |
1018 /* In builtins.c */ | 1044 /* In builtins.c */ |
1019 extern bool validate_gimple_arglist (const_gimple, ...); | 1045 extern bool validate_gimple_arglist (const_gimple, ...); |
1020 | 1046 |
1021 /* In tree-ssa-operands.c */ | |
1022 extern void gimple_add_to_addresses_taken (gimple, tree); | |
1023 | |
1024 /* In tree-ssa.c */ | 1047 /* In tree-ssa.c */ |
1025 extern bool tree_ssa_useless_type_conversion (tree); | 1048 extern bool tree_ssa_useless_type_conversion (tree); |
1049 extern tree tree_ssa_strip_useless_type_conversions (tree); | |
1026 extern bool useless_type_conversion_p (tree, tree); | 1050 extern bool useless_type_conversion_p (tree, tree); |
1027 extern bool types_compatible_p (tree, tree); | 1051 extern bool types_compatible_p (tree, tree); |
1028 | 1052 |
1029 /* Return the code for GIMPLE statement G. */ | 1053 /* Return the code for GIMPLE statement G. */ |
1030 | 1054 |
1031 static inline enum gimple_code | 1055 static inline enum gimple_code |
1032 gimple_code (const_gimple g) | 1056 gimple_code (const_gimple g) |
1033 { | 1057 { |
1034 return g->gsbase.code; | 1058 return g->gsbase.code; |
1059 } | |
1060 | |
1061 | |
1062 /* Return the GSS code used by a GIMPLE code. */ | |
1063 | |
1064 static inline enum gimple_statement_structure_enum | |
1065 gss_for_code (enum gimple_code code) | |
1066 { | |
1067 gcc_assert ((unsigned int)code < LAST_AND_UNUSED_GIMPLE_CODE); | |
1068 return gss_for_code_[code]; | |
1069 } | |
1070 | |
1071 | |
1072 /* Return which GSS code is used by GS. */ | |
1073 | |
1074 static inline enum gimple_statement_structure_enum | |
1075 gimple_statement_structure (gimple gs) | |
1076 { | |
1077 return gss_for_code (gimple_code (gs)); | |
1035 } | 1078 } |
1036 | 1079 |
1037 | 1080 |
1038 /* Return true if statement G has sub-statements. This is only true for | 1081 /* Return true if statement G has sub-statements. This is only true for |
1039 High GIMPLE statements. */ | 1082 High GIMPLE statements. */ |
1061 | 1104 |
1062 default: | 1105 default: |
1063 return false; | 1106 return false; |
1064 } | 1107 } |
1065 } | 1108 } |
1066 | 1109 |
1067 | 1110 |
1068 /* Return the basic block holding statement G. */ | 1111 /* Return the basic block holding statement G. */ |
1069 | 1112 |
1070 static inline struct basic_block_def * | 1113 static inline struct basic_block_def * |
1071 gimple_bb (const_gimple g) | 1114 gimple_bb (const_gimple g) |
1242 gimple_has_mem_ops (const_gimple g) | 1285 gimple_has_mem_ops (const_gimple g) |
1243 { | 1286 { |
1244 return gimple_code (g) >= GIMPLE_ASSIGN && gimple_code (g) <= GIMPLE_RETURN; | 1287 return gimple_code (g) >= GIMPLE_ASSIGN && gimple_code (g) <= GIMPLE_RETURN; |
1245 } | 1288 } |
1246 | 1289 |
1247 /* Return the set of addresses taken by statement G. */ | |
1248 | |
1249 static inline bitmap | |
1250 gimple_addresses_taken (const_gimple g) | |
1251 { | |
1252 if (gimple_has_ops (g)) | |
1253 return g->gsops.opbase.addresses_taken; | |
1254 else | |
1255 return NULL; | |
1256 } | |
1257 | |
1258 | |
1259 /* Return a pointer to the set of addresses taken by statement G. */ | |
1260 | |
1261 static inline bitmap * | |
1262 gimple_addresses_taken_ptr (gimple g) | |
1263 { | |
1264 if (gimple_has_ops (g)) | |
1265 return &g->gsops.opbase.addresses_taken; | |
1266 else | |
1267 return NULL; | |
1268 } | |
1269 | |
1270 | |
1271 /* Set B to be the set of addresses taken by statement G. The | |
1272 previous set is freed. */ | |
1273 | |
1274 static inline void | |
1275 gimple_set_addresses_taken (gimple g, bitmap b) | |
1276 { | |
1277 gcc_assert (gimple_has_ops (g)); | |
1278 BITMAP_FREE (g->gsops.opbase.addresses_taken); | |
1279 g->gsops.opbase.addresses_taken = b; | |
1280 } | |
1281 | |
1282 | 1290 |
1283 /* Return the set of DEF operands for statement G. */ | 1291 /* Return the set of DEF operands for statement G. */ |
1284 | 1292 |
1285 static inline struct def_optype_d * | 1293 static inline struct def_optype_d * |
1286 gimple_def_ops (const_gimple g) | 1294 gimple_def_ops (const_gimple g) |
1320 gcc_assert (gimple_has_ops (g)); | 1328 gcc_assert (gimple_has_ops (g)); |
1321 g->gsops.opbase.use_ops = use; | 1329 g->gsops.opbase.use_ops = use; |
1322 } | 1330 } |
1323 | 1331 |
1324 | 1332 |
1325 /* Return the set of VUSE operands for statement G. */ | 1333 /* Return the set of VUSE operand for statement G. */ |
1326 | 1334 |
1327 static inline struct voptype_d * | 1335 static inline use_operand_p |
1328 gimple_vuse_ops (const_gimple g) | 1336 gimple_vuse_op (const_gimple g) |
1337 { | |
1338 struct use_optype_d *ops; | |
1339 if (!gimple_has_mem_ops (g)) | |
1340 return NULL_USE_OPERAND_P; | |
1341 ops = g->gsops.opbase.use_ops; | |
1342 if (ops | |
1343 && USE_OP_PTR (ops)->use == &g->gsmembase.vuse) | |
1344 return USE_OP_PTR (ops); | |
1345 return NULL_USE_OPERAND_P; | |
1346 } | |
1347 | |
1348 /* Return the set of VDEF operand for statement G. */ | |
1349 | |
1350 static inline def_operand_p | |
1351 gimple_vdef_op (const_gimple g) | |
1352 { | |
1353 struct def_optype_d *ops; | |
1354 if (!gimple_has_mem_ops (g)) | |
1355 return NULL_DEF_OPERAND_P; | |
1356 ops = g->gsops.opbase.def_ops; | |
1357 if (ops | |
1358 && DEF_OP_PTR (ops) == &g->gsmembase.vdef) | |
1359 return DEF_OP_PTR (ops); | |
1360 return NULL_DEF_OPERAND_P; | |
1361 } | |
1362 | |
1363 | |
1364 /* Return the single VUSE operand of the statement G. */ | |
1365 | |
1366 static inline tree | |
1367 gimple_vuse (const_gimple g) | |
1368 { | |
1369 if (!gimple_has_mem_ops (g)) | |
1370 return NULL_TREE; | |
1371 return g->gsmembase.vuse; | |
1372 } | |
1373 | |
1374 /* Return the single VDEF operand of the statement G. */ | |
1375 | |
1376 static inline tree | |
1377 gimple_vdef (const_gimple g) | |
1378 { | |
1379 if (!gimple_has_mem_ops (g)) | |
1380 return NULL_TREE; | |
1381 return g->gsmembase.vdef; | |
1382 } | |
1383 | |
1384 /* Return the single VUSE operand of the statement G. */ | |
1385 | |
1386 static inline tree * | |
1387 gimple_vuse_ptr (gimple g) | |
1329 { | 1388 { |
1330 if (!gimple_has_mem_ops (g)) | 1389 if (!gimple_has_mem_ops (g)) |
1331 return NULL; | 1390 return NULL; |
1332 return g->gsmem.membase.vuse_ops; | 1391 return &g->gsmembase.vuse; |
1333 } | 1392 } |
1334 | 1393 |
1335 | 1394 /* Return the single VDEF operand of the statement G. */ |
1336 /* Set OPS to be the set of VUSE operands for statement G. */ | 1395 |
1337 | 1396 static inline tree * |
1338 static inline void | 1397 gimple_vdef_ptr (gimple g) |
1339 gimple_set_vuse_ops (gimple g, struct voptype_d *ops) | |
1340 { | |
1341 gcc_assert (gimple_has_mem_ops (g)); | |
1342 g->gsmem.membase.vuse_ops = ops; | |
1343 } | |
1344 | |
1345 | |
1346 /* Return the set of VDEF operands for statement G. */ | |
1347 | |
1348 static inline struct voptype_d * | |
1349 gimple_vdef_ops (const_gimple g) | |
1350 { | 1398 { |
1351 if (!gimple_has_mem_ops (g)) | 1399 if (!gimple_has_mem_ops (g)) |
1352 return NULL; | 1400 return NULL; |
1353 return g->gsmem.membase.vdef_ops; | 1401 return &g->gsmembase.vdef; |
1354 } | 1402 } |
1355 | 1403 |
1356 | 1404 /* Set the single VUSE operand of the statement G. */ |
1357 /* Set OPS to be the set of VDEF operands for statement G. */ | 1405 |
1358 | 1406 static inline void |
1359 static inline void | 1407 gimple_set_vuse (gimple g, tree vuse) |
1360 gimple_set_vdef_ops (gimple g, struct voptype_d *ops) | |
1361 { | 1408 { |
1362 gcc_assert (gimple_has_mem_ops (g)); | 1409 gcc_assert (gimple_has_mem_ops (g)); |
1363 g->gsmem.membase.vdef_ops = ops; | 1410 g->gsmembase.vuse = vuse; |
1364 } | 1411 } |
1365 | 1412 |
1366 | 1413 /* Set the single VDEF operand of the statement G. */ |
1367 /* Return the set of symbols loaded by statement G. Each element of the | 1414 |
1368 set is the DECL_UID of the corresponding symbol. */ | 1415 static inline void |
1369 | 1416 gimple_set_vdef (gimple g, tree vdef) |
1370 static inline bitmap | 1417 { |
1371 gimple_loaded_syms (const_gimple g) | 1418 gcc_assert (gimple_has_mem_ops (g)); |
1372 { | 1419 g->gsmembase.vdef = vdef; |
1373 if (!gimple_has_mem_ops (g)) | |
1374 return NULL; | |
1375 return g->gsmem.membase.loads; | |
1376 } | |
1377 | |
1378 | |
1379 /* Return the set of symbols stored by statement G. Each element of | |
1380 the set is the DECL_UID of the corresponding symbol. */ | |
1381 | |
1382 static inline bitmap | |
1383 gimple_stored_syms (const_gimple g) | |
1384 { | |
1385 if (!gimple_has_mem_ops (g)) | |
1386 return NULL; | |
1387 return g->gsmem.membase.stores; | |
1388 } | 1420 } |
1389 | 1421 |
1390 | 1422 |
1391 /* Return true if statement G has operands and the modified field has | 1423 /* Return true if statement G has operands and the modified field has |
1392 been set. */ | 1424 been set. */ |
1463 /* Return true if statement STMT may access memory. */ | 1495 /* Return true if statement STMT may access memory. */ |
1464 | 1496 |
1465 static inline bool | 1497 static inline bool |
1466 gimple_references_memory_p (gimple stmt) | 1498 gimple_references_memory_p (gimple stmt) |
1467 { | 1499 { |
1468 return gimple_has_mem_ops (stmt) && stmt->gsbase.references_memory_p; | 1500 return gimple_has_mem_ops (stmt) && gimple_vuse (stmt); |
1469 } | 1501 } |
1470 | 1502 |
1471 | |
1472 /* Set the REFERENCES_MEMORY_P flag for STMT to MEM_P. */ | |
1473 | |
1474 static inline void | |
1475 gimple_set_references_memory (gimple stmt, bool mem_p) | |
1476 { | |
1477 if (gimple_has_mem_ops (stmt)) | |
1478 stmt->gsbase.references_memory_p = (unsigned) mem_p; | |
1479 } | |
1480 | 1503 |
1481 /* Return the subcode for OMP statement S. */ | 1504 /* Return the subcode for OMP statement S. */ |
1482 | 1505 |
1483 static inline unsigned | 1506 static inline unsigned |
1484 gimple_omp_subcode (const_gimple s) | 1507 gimple_omp_subcode (const_gimple s) |
1587 /* Return the array of operands for statement GS. */ | 1610 /* Return the array of operands for statement GS. */ |
1588 | 1611 |
1589 static inline tree * | 1612 static inline tree * |
1590 gimple_ops (gimple gs) | 1613 gimple_ops (gimple gs) |
1591 { | 1614 { |
1592 /* Offset in bytes to the location of the operand vector in every | 1615 size_t off; |
1593 tuple structure. Defined in gimple.c */ | |
1594 extern size_t const gimple_ops_offset_[]; | |
1595 | |
1596 if (!gimple_has_ops (gs)) | |
1597 return NULL; | |
1598 | 1616 |
1599 /* All the tuples have their operand vector at the very bottom | 1617 /* All the tuples have their operand vector at the very bottom |
1600 of the structure. */ | 1618 of the structure. Note that those structures that do not |
1601 return ((tree *) ((char *) gs + gimple_ops_offset_[gimple_code (gs)])); | 1619 have an operand vector have a zero offset. */ |
1620 off = gimple_ops_offset_[gimple_statement_structure (gs)]; | |
1621 gcc_assert (off != 0); | |
1622 | |
1623 return (tree *) ((char *) gs + off); | |
1602 } | 1624 } |
1603 | 1625 |
1604 | 1626 |
1605 /* Return operand I for statement GS. */ | 1627 /* Return operand I for statement GS. */ |
1606 | 1628 |
1927 static inline void | 1949 static inline void |
1928 gimple_call_set_fndecl (gimple gs, tree decl) | 1950 gimple_call_set_fndecl (gimple gs, tree decl) |
1929 { | 1951 { |
1930 GIMPLE_CHECK (gs, GIMPLE_CALL); | 1952 GIMPLE_CHECK (gs, GIMPLE_CALL); |
1931 gcc_assert (TREE_CODE (decl) == FUNCTION_DECL); | 1953 gcc_assert (TREE_CODE (decl) == FUNCTION_DECL); |
1932 gimple_set_op (gs, 1, build_fold_addr_expr (decl)); | 1954 gimple_set_op (gs, 1, build_fold_addr_expr_loc (gimple_location (gs), decl)); |
1933 } | 1955 } |
1934 | 1956 |
1935 | 1957 |
1936 /* If a given GIMPLE_CALL's callee is a FUNCTION_DECL, return it. | 1958 /* If a given GIMPLE_CALL's callee is a FUNCTION_DECL, return it. |
1937 Otherwise return NULL. This function is analogous to | 1959 Otherwise return NULL. This function is analogous to |
2242 | 2264 |
2243 static inline enum tree_code | 2265 static inline enum tree_code |
2244 gimple_cond_code (const_gimple gs) | 2266 gimple_cond_code (const_gimple gs) |
2245 { | 2267 { |
2246 GIMPLE_CHECK (gs, GIMPLE_COND); | 2268 GIMPLE_CHECK (gs, GIMPLE_COND); |
2247 return gs->gsbase.subcode; | 2269 return (enum tree_code) gs->gsbase.subcode; |
2248 } | 2270 } |
2249 | 2271 |
2250 | 2272 |
2251 /* Set CODE to be the predicate code for the conditional statement GS. */ | 2273 /* Set CODE to be the predicate code for the conditional statement GS. */ |
2252 | 2274 |
2498 } | 2520 } |
2499 | 2521 |
2500 | 2522 |
2501 /* Set DEST to be the destination of the unconditonal jump GS. */ | 2523 /* Set DEST to be the destination of the unconditonal jump GS. */ |
2502 | 2524 |
2503 static inline void | 2525 static inline void |
2504 gimple_goto_set_dest (gimple gs, tree dest) | 2526 gimple_goto_set_dest (gimple gs, tree dest) |
2505 { | 2527 { |
2506 GIMPLE_CHECK (gs, GIMPLE_GOTO); | 2528 GIMPLE_CHECK (gs, GIMPLE_GOTO); |
2507 gcc_assert (is_gimple_operand (dest)); | 2529 gcc_assert (is_gimple_operand (dest)); |
2508 gimple_set_op (gs, 0, dest); | 2530 gimple_set_op (gs, 0, dest); |
2632 { | 2654 { |
2633 GIMPLE_CHECK (gs, GIMPLE_ASM); | 2655 GIMPLE_CHECK (gs, GIMPLE_ASM); |
2634 return gs->gimple_asm.nc; | 2656 return gs->gimple_asm.nc; |
2635 } | 2657 } |
2636 | 2658 |
2659 /* Return the number of label operands for GIMPLE_ASM GS. */ | |
2660 | |
2661 static inline unsigned | |
2662 gimple_asm_nlabels (const_gimple gs) | |
2663 { | |
2664 GIMPLE_CHECK (gs, GIMPLE_ASM); | |
2665 return gs->gimple_asm.nl; | |
2666 } | |
2637 | 2667 |
2638 /* Return input operand INDEX of GIMPLE_ASM GS. */ | 2668 /* Return input operand INDEX of GIMPLE_ASM GS. */ |
2639 | 2669 |
2640 static inline tree | 2670 static inline tree |
2641 gimple_asm_input_op (const_gimple gs, unsigned index) | 2671 gimple_asm_input_op (const_gimple gs, unsigned index) |
2721 gcc_assert (index <= gs->gimple_asm.nc); | 2751 gcc_assert (index <= gs->gimple_asm.nc); |
2722 gcc_assert (TREE_CODE (clobber_op) == TREE_LIST); | 2752 gcc_assert (TREE_CODE (clobber_op) == TREE_LIST); |
2723 gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.no, clobber_op); | 2753 gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.no, clobber_op); |
2724 } | 2754 } |
2725 | 2755 |
2756 /* Return label operand INDEX of GIMPLE_ASM GS. */ | |
2757 | |
2758 static inline tree | |
2759 gimple_asm_label_op (const_gimple gs, unsigned index) | |
2760 { | |
2761 GIMPLE_CHECK (gs, GIMPLE_ASM); | |
2762 gcc_assert (index <= gs->gimple_asm.nl); | |
2763 return gimple_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.nc); | |
2764 } | |
2765 | |
2766 /* Set LABEL_OP to be label operand INDEX in GIMPLE_ASM GS. */ | |
2767 | |
2768 static inline void | |
2769 gimple_asm_set_label_op (gimple gs, unsigned index, tree label_op) | |
2770 { | |
2771 GIMPLE_CHECK (gs, GIMPLE_ASM); | |
2772 gcc_assert (index <= gs->gimple_asm.nl); | |
2773 gcc_assert (TREE_CODE (label_op) == TREE_LIST); | |
2774 gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.nc, label_op); | |
2775 } | |
2726 | 2776 |
2727 /* Return the string representing the assembly instruction in | 2777 /* Return the string representing the assembly instruction in |
2728 GIMPLE_ASM GS. */ | 2778 GIMPLE_ASM GS. */ |
2729 | 2779 |
2730 static inline const char * | 2780 static inline const char * |
2893 { | 2943 { |
2894 GIMPLE_CHECK (gs, GIMPLE_EH_FILTER); | 2944 GIMPLE_CHECK (gs, GIMPLE_EH_FILTER); |
2895 gs->gimple_eh_filter.failure = failure; | 2945 gs->gimple_eh_filter.failure = failure; |
2896 } | 2946 } |
2897 | 2947 |
2898 /* Return the EH_FILTER_MUST_NOT_THROW flag. */ | 2948 /* Get the function decl to be called by the MUST_NOT_THROW region. */ |
2899 | 2949 |
2900 static inline bool | 2950 static inline tree |
2901 | 2951 gimple_eh_must_not_throw_fndecl (gimple gs) |
2902 gimple_eh_filter_must_not_throw (gimple gs) | 2952 { |
2903 { | 2953 GIMPLE_CHECK (gs, GIMPLE_EH_MUST_NOT_THROW); |
2904 GIMPLE_CHECK (gs, GIMPLE_EH_FILTER); | 2954 return gs->gimple_eh_mnt.fndecl; |
2905 return gs->gsbase.subcode != 0; | 2955 } |
2906 } | 2956 |
2907 | 2957 /* Set the function decl to be called by GS to DECL. */ |
2908 /* Set the EH_FILTER_MUST_NOT_THROW flag to the value MNTP. */ | 2958 |
2909 | 2959 static inline void |
2910 static inline void | 2960 gimple_eh_must_not_throw_set_fndecl (gimple gs, tree decl) |
2911 gimple_eh_filter_set_must_not_throw (gimple gs, bool mntp) | 2961 { |
2912 { | 2962 GIMPLE_CHECK (gs, GIMPLE_EH_MUST_NOT_THROW); |
2913 GIMPLE_CHECK (gs, GIMPLE_EH_FILTER); | 2963 gs->gimple_eh_mnt.fndecl = decl; |
2914 gs->gsbase.subcode = (unsigned int) mntp; | |
2915 } | 2964 } |
2916 | 2965 |
2917 | 2966 |
2918 /* GIMPLE_TRY accessors. */ | 2967 /* GIMPLE_TRY accessors. */ |
2919 | 2968 |
3122 | 3171 |
3123 static inline int | 3172 static inline int |
3124 gimple_resx_region (const_gimple gs) | 3173 gimple_resx_region (const_gimple gs) |
3125 { | 3174 { |
3126 GIMPLE_CHECK (gs, GIMPLE_RESX); | 3175 GIMPLE_CHECK (gs, GIMPLE_RESX); |
3127 return gs->gimple_resx.region; | 3176 return gs->gimple_eh_ctrl.region; |
3128 } | 3177 } |
3129 | 3178 |
3130 /* Set REGION to be the region number for GIMPLE_RESX GS. */ | 3179 /* Set REGION to be the region number for GIMPLE_RESX GS. */ |
3131 | 3180 |
3132 static inline void | 3181 static inline void |
3133 gimple_resx_set_region (gimple gs, int region) | 3182 gimple_resx_set_region (gimple gs, int region) |
3134 { | 3183 { |
3135 GIMPLE_CHECK (gs, GIMPLE_RESX); | 3184 GIMPLE_CHECK (gs, GIMPLE_RESX); |
3136 gs->gimple_resx.region = region; | 3185 gs->gimple_eh_ctrl.region = region; |
3137 } | 3186 } |
3138 | 3187 |
3188 /* Return the region number for GIMPLE_EH_DISPATCH GS. */ | |
3189 | |
3190 static inline int | |
3191 gimple_eh_dispatch_region (const_gimple gs) | |
3192 { | |
3193 GIMPLE_CHECK (gs, GIMPLE_EH_DISPATCH); | |
3194 return gs->gimple_eh_ctrl.region; | |
3195 } | |
3196 | |
3197 /* Set REGION to be the region number for GIMPLE_EH_DISPATCH GS. */ | |
3198 | |
3199 static inline void | |
3200 gimple_eh_dispatch_set_region (gimple gs, int region) | |
3201 { | |
3202 GIMPLE_CHECK (gs, GIMPLE_EH_DISPATCH); | |
3203 gs->gimple_eh_ctrl.region = region; | |
3204 } | |
3139 | 3205 |
3140 /* Return the number of labels associated with the switch statement GS. */ | 3206 /* Return the number of labels associated with the switch statement GS. */ |
3141 | 3207 |
3142 static inline unsigned | 3208 static inline unsigned |
3143 gimple_switch_num_labels (const_gimple gs) | 3209 gimple_switch_num_labels (const_gimple gs) |
3227 gimple_switch_set_default_label (gimple gs, tree label) | 3293 gimple_switch_set_default_label (gimple gs, tree label) |
3228 { | 3294 { |
3229 gimple_switch_set_label (gs, 0, label); | 3295 gimple_switch_set_label (gs, 0, label); |
3230 } | 3296 } |
3231 | 3297 |
3298 /* Return true if GS is a GIMPLE_DEBUG statement. */ | |
3299 | |
3300 static inline bool | |
3301 is_gimple_debug (const_gimple gs) | |
3302 { | |
3303 return gimple_code (gs) == GIMPLE_DEBUG; | |
3304 } | |
3305 | |
3306 /* Return true if S is a GIMPLE_DEBUG BIND statement. */ | |
3307 | |
3308 static inline bool | |
3309 gimple_debug_bind_p (const_gimple s) | |
3310 { | |
3311 if (is_gimple_debug (s)) | |
3312 return s->gsbase.subcode == GIMPLE_DEBUG_BIND; | |
3313 | |
3314 return false; | |
3315 } | |
3316 | |
3317 /* Return the variable bound in a GIMPLE_DEBUG bind statement. */ | |
3318 | |
3319 static inline tree | |
3320 gimple_debug_bind_get_var (gimple dbg) | |
3321 { | |
3322 GIMPLE_CHECK (dbg, GIMPLE_DEBUG); | |
3323 gcc_assert (gimple_debug_bind_p (dbg)); | |
3324 return gimple_op (dbg, 0); | |
3325 } | |
3326 | |
3327 /* Return the value bound to the variable in a GIMPLE_DEBUG bind | |
3328 statement. */ | |
3329 | |
3330 static inline tree | |
3331 gimple_debug_bind_get_value (gimple dbg) | |
3332 { | |
3333 GIMPLE_CHECK (dbg, GIMPLE_DEBUG); | |
3334 gcc_assert (gimple_debug_bind_p (dbg)); | |
3335 return gimple_op (dbg, 1); | |
3336 } | |
3337 | |
3338 /* Return a pointer to the value bound to the variable in a | |
3339 GIMPLE_DEBUG bind statement. */ | |
3340 | |
3341 static inline tree * | |
3342 gimple_debug_bind_get_value_ptr (gimple dbg) | |
3343 { | |
3344 GIMPLE_CHECK (dbg, GIMPLE_DEBUG); | |
3345 gcc_assert (gimple_debug_bind_p (dbg)); | |
3346 return gimple_op_ptr (dbg, 1); | |
3347 } | |
3348 | |
3349 /* Set the variable bound in a GIMPLE_DEBUG bind statement. */ | |
3350 | |
3351 static inline void | |
3352 gimple_debug_bind_set_var (gimple dbg, tree var) | |
3353 { | |
3354 GIMPLE_CHECK (dbg, GIMPLE_DEBUG); | |
3355 gcc_assert (gimple_debug_bind_p (dbg)); | |
3356 gimple_set_op (dbg, 0, var); | |
3357 } | |
3358 | |
3359 /* Set the value bound to the variable in a GIMPLE_DEBUG bind | |
3360 statement. */ | |
3361 | |
3362 static inline void | |
3363 gimple_debug_bind_set_value (gimple dbg, tree value) | |
3364 { | |
3365 GIMPLE_CHECK (dbg, GIMPLE_DEBUG); | |
3366 gcc_assert (gimple_debug_bind_p (dbg)); | |
3367 gimple_set_op (dbg, 1, value); | |
3368 } | |
3369 | |
3370 /* The second operand of a GIMPLE_DEBUG_BIND, when the value was | |
3371 optimized away. */ | |
3372 #define GIMPLE_DEBUG_BIND_NOVALUE NULL_TREE /* error_mark_node */ | |
3373 | |
3374 /* Remove the value bound to the variable in a GIMPLE_DEBUG bind | |
3375 statement. */ | |
3376 | |
3377 static inline void | |
3378 gimple_debug_bind_reset_value (gimple dbg) | |
3379 { | |
3380 GIMPLE_CHECK (dbg, GIMPLE_DEBUG); | |
3381 gcc_assert (gimple_debug_bind_p (dbg)); | |
3382 gimple_set_op (dbg, 1, GIMPLE_DEBUG_BIND_NOVALUE); | |
3383 } | |
3384 | |
3385 /* Return true if the GIMPLE_DEBUG bind statement is bound to a | |
3386 value. */ | |
3387 | |
3388 static inline bool | |
3389 gimple_debug_bind_has_value_p (gimple dbg) | |
3390 { | |
3391 GIMPLE_CHECK (dbg, GIMPLE_DEBUG); | |
3392 gcc_assert (gimple_debug_bind_p (dbg)); | |
3393 return gimple_op (dbg, 1) != GIMPLE_DEBUG_BIND_NOVALUE; | |
3394 } | |
3395 | |
3396 #undef GIMPLE_DEBUG_BIND_NOVALUE | |
3232 | 3397 |
3233 /* Return the body for the OMP statement GS. */ | 3398 /* Return the body for the OMP statement GS. */ |
3234 | 3399 |
3235 static inline gimple_seq | 3400 static inline gimple_seq |
3236 gimple_omp_body (gimple gs) | 3401 gimple_omp_body (gimple gs) |
3237 { | 3402 { |
3238 return gs->omp.body; | 3403 return gs->omp.body; |
3239 } | 3404 } |
3240 | 3405 |
4146 } | 4311 } |
4147 | 4312 |
4148 | 4313 |
4149 /* Returns true when the gimple statment STMT is any of the OpenMP types. */ | 4314 /* Returns true when the gimple statment STMT is any of the OpenMP types. */ |
4150 | 4315 |
4316 #define CASE_GIMPLE_OMP \ | |
4317 case GIMPLE_OMP_PARALLEL: \ | |
4318 case GIMPLE_OMP_TASK: \ | |
4319 case GIMPLE_OMP_FOR: \ | |
4320 case GIMPLE_OMP_SECTIONS: \ | |
4321 case GIMPLE_OMP_SECTIONS_SWITCH: \ | |
4322 case GIMPLE_OMP_SINGLE: \ | |
4323 case GIMPLE_OMP_SECTION: \ | |
4324 case GIMPLE_OMP_MASTER: \ | |
4325 case GIMPLE_OMP_ORDERED: \ | |
4326 case GIMPLE_OMP_CRITICAL: \ | |
4327 case GIMPLE_OMP_RETURN: \ | |
4328 case GIMPLE_OMP_ATOMIC_LOAD: \ | |
4329 case GIMPLE_OMP_ATOMIC_STORE: \ | |
4330 case GIMPLE_OMP_CONTINUE | |
4331 | |
4151 static inline bool | 4332 static inline bool |
4152 is_gimple_omp (const_gimple stmt) | 4333 is_gimple_omp (const_gimple stmt) |
4153 { | 4334 { |
4154 return (gimple_code (stmt) == GIMPLE_OMP_PARALLEL | 4335 switch (gimple_code (stmt)) |
4155 || gimple_code (stmt) == GIMPLE_OMP_TASK | 4336 { |
4156 || gimple_code (stmt) == GIMPLE_OMP_FOR | 4337 CASE_GIMPLE_OMP: |
4157 || gimple_code (stmt) == GIMPLE_OMP_SECTIONS | 4338 return true; |
4158 || gimple_code (stmt) == GIMPLE_OMP_SECTIONS_SWITCH | 4339 default: |
4159 || gimple_code (stmt) == GIMPLE_OMP_SINGLE | 4340 return false; |
4160 || gimple_code (stmt) == GIMPLE_OMP_SECTION | 4341 } |
4161 || gimple_code (stmt) == GIMPLE_OMP_MASTER | |
4162 || gimple_code (stmt) == GIMPLE_OMP_ORDERED | |
4163 || gimple_code (stmt) == GIMPLE_OMP_CRITICAL | |
4164 || gimple_code (stmt) == GIMPLE_OMP_RETURN | |
4165 || gimple_code (stmt) == GIMPLE_OMP_ATOMIC_LOAD | |
4166 || gimple_code (stmt) == GIMPLE_OMP_ATOMIC_STORE | |
4167 || gimple_code (stmt) == GIMPLE_OMP_CONTINUE); | |
4168 } | 4342 } |
4169 | 4343 |
4170 | 4344 |
4171 /* Returns TRUE if statement G is a GIMPLE_NOP. */ | 4345 /* Returns TRUE if statement G is a GIMPLE_NOP. */ |
4172 | 4346 |
4175 { | 4349 { |
4176 return gimple_code (g) == GIMPLE_NOP; | 4350 return gimple_code (g) == GIMPLE_NOP; |
4177 } | 4351 } |
4178 | 4352 |
4179 | 4353 |
4180 /* Return the new type set by GIMPLE_CHANGE_DYNAMIC_TYPE statement GS. */ | 4354 /* Return true if GS is a GIMPLE_RESX. */ |
4181 | 4355 |
4182 static inline tree | 4356 static inline bool |
4183 gimple_cdt_new_type (gimple gs) | 4357 is_gimple_resx (const_gimple gs) |
4184 { | 4358 { |
4185 GIMPLE_CHECK (gs, GIMPLE_CHANGE_DYNAMIC_TYPE); | 4359 return gimple_code (gs) == GIMPLE_RESX; |
4186 return gimple_op (gs, 1); | 4360 } |
4187 } | |
4188 | |
4189 /* Return a pointer to the new type set by GIMPLE_CHANGE_DYNAMIC_TYPE | |
4190 statement GS. */ | |
4191 | |
4192 static inline tree * | |
4193 gimple_cdt_new_type_ptr (gimple gs) | |
4194 { | |
4195 GIMPLE_CHECK (gs, GIMPLE_CHANGE_DYNAMIC_TYPE); | |
4196 return gimple_op_ptr (gs, 1); | |
4197 } | |
4198 | |
4199 /* Set NEW_TYPE to be the type returned by GIMPLE_CHANGE_DYNAMIC_TYPE | |
4200 statement GS. */ | |
4201 | |
4202 static inline void | |
4203 gimple_cdt_set_new_type (gimple gs, tree new_type) | |
4204 { | |
4205 GIMPLE_CHECK (gs, GIMPLE_CHANGE_DYNAMIC_TYPE); | |
4206 gcc_assert (TREE_CODE_CLASS (TREE_CODE (new_type)) == tcc_type); | |
4207 gimple_set_op (gs, 1, new_type); | |
4208 } | |
4209 | |
4210 | |
4211 /* Return the location affected by GIMPLE_CHANGE_DYNAMIC_TYPE statement GS. */ | |
4212 | |
4213 static inline tree | |
4214 gimple_cdt_location (gimple gs) | |
4215 { | |
4216 GIMPLE_CHECK (gs, GIMPLE_CHANGE_DYNAMIC_TYPE); | |
4217 return gimple_op (gs, 0); | |
4218 } | |
4219 | |
4220 | |
4221 /* Return a pointer to the location affected by GIMPLE_CHANGE_DYNAMIC_TYPE | |
4222 statement GS. */ | |
4223 | |
4224 static inline tree * | |
4225 gimple_cdt_location_ptr (gimple gs) | |
4226 { | |
4227 GIMPLE_CHECK (gs, GIMPLE_CHANGE_DYNAMIC_TYPE); | |
4228 return gimple_op_ptr (gs, 0); | |
4229 } | |
4230 | |
4231 | |
4232 /* Set PTR to be the location affected by GIMPLE_CHANGE_DYNAMIC_TYPE | |
4233 statement GS. */ | |
4234 | |
4235 static inline void | |
4236 gimple_cdt_set_location (gimple gs, tree ptr) | |
4237 { | |
4238 GIMPLE_CHECK (gs, GIMPLE_CHANGE_DYNAMIC_TYPE); | |
4239 gimple_set_op (gs, 0, ptr); | |
4240 } | |
4241 | |
4242 | 4361 |
4243 /* Return the predictor of GIMPLE_PREDICT statement GS. */ | 4362 /* Return the predictor of GIMPLE_PREDICT statement GS. */ |
4244 | 4363 |
4245 static inline enum br_predictor | 4364 static inline enum br_predictor |
4246 gimple_predict_predictor (gimple gs) | 4365 gimple_predict_predictor (gimple gs) |
4311 default: | 4430 default: |
4312 /* As fallback use the type of the LHS. */ | 4431 /* As fallback use the type of the LHS. */ |
4313 type = TREE_TYPE (gimple_get_lhs (stmt)); | 4432 type = TREE_TYPE (gimple_get_lhs (stmt)); |
4314 break; | 4433 break; |
4315 } | 4434 } |
4316 | |
4317 /* Integral sub-types are never the type of the expression, | |
4318 but they still can be the type of the result as the base | |
4319 type (in which expressions are computed) is trivially | |
4320 convertible to one of its sub-types. So always return | |
4321 the base type here. */ | |
4322 if (INTEGRAL_TYPE_P (type) | |
4323 && TREE_TYPE (type) | |
4324 /* But only if they are trivially convertible. */ | |
4325 && useless_type_conversion_p (type, TREE_TYPE (type))) | |
4326 type = TREE_TYPE (type); | |
4327 return type; | 4435 return type; |
4328 } | 4436 } |
4329 else if (code == GIMPLE_COND) | 4437 else if (code == GIMPLE_COND) |
4330 return boolean_type_node; | 4438 return boolean_type_node; |
4331 else | 4439 else |
4353 static inline gimple_stmt_iterator | 4461 static inline gimple_stmt_iterator |
4354 gsi_start_bb (basic_block bb) | 4462 gsi_start_bb (basic_block bb) |
4355 { | 4463 { |
4356 gimple_stmt_iterator i; | 4464 gimple_stmt_iterator i; |
4357 gimple_seq seq; | 4465 gimple_seq seq; |
4358 | 4466 |
4359 seq = bb_seq (bb); | 4467 seq = bb_seq (bb); |
4360 i.ptr = gimple_seq_first (seq); | 4468 i.ptr = gimple_seq_first (seq); |
4361 i.seq = seq; | 4469 i.seq = seq; |
4362 i.bb = bb; | 4470 i.bb = bb; |
4363 | 4471 |
4451 gsi_next (&gsi); | 4559 gsi_next (&gsi); |
4452 | 4560 |
4453 return gsi; | 4561 return gsi; |
4454 } | 4562 } |
4455 | 4563 |
4564 /* Advance the iterator to the next non-debug gimple statement. */ | |
4565 | |
4566 static inline void | |
4567 gsi_next_nondebug (gimple_stmt_iterator *i) | |
4568 { | |
4569 do | |
4570 { | |
4571 gsi_next (i); | |
4572 } | |
4573 while (!gsi_end_p (*i) && is_gimple_debug (gsi_stmt (*i))); | |
4574 } | |
4575 | |
4576 /* Advance the iterator to the next non-debug gimple statement. */ | |
4577 | |
4578 static inline void | |
4579 gsi_prev_nondebug (gimple_stmt_iterator *i) | |
4580 { | |
4581 do | |
4582 { | |
4583 gsi_prev (i); | |
4584 } | |
4585 while (!gsi_end_p (*i) && is_gimple_debug (gsi_stmt (*i))); | |
4586 } | |
4587 | |
4588 /* Return a new iterator pointing to the first non-debug statement in | |
4589 basic block BB. */ | |
4590 | |
4591 static inline gimple_stmt_iterator | |
4592 gsi_start_nondebug_bb (basic_block bb) | |
4593 { | |
4594 gimple_stmt_iterator i = gsi_start_bb (bb); | |
4595 | |
4596 if (!gsi_end_p (i) && is_gimple_debug (gsi_stmt (i))) | |
4597 gsi_next_nondebug (&i); | |
4598 | |
4599 return i; | |
4600 } | |
4601 | |
4602 /* Return a new iterator pointing to the last non-debug statement in | |
4603 basic block BB. */ | |
4604 | |
4605 static inline gimple_stmt_iterator | |
4606 gsi_last_nondebug_bb (basic_block bb) | |
4607 { | |
4608 gimple_stmt_iterator i = gsi_last_bb (bb); | |
4609 | |
4610 if (!gsi_end_p (i) && is_gimple_debug (gsi_stmt (i))) | |
4611 gsi_prev_nondebug (&i); | |
4612 | |
4613 return i; | |
4614 } | |
4615 | |
4456 /* Return a pointer to the current stmt. | 4616 /* Return a pointer to the current stmt. |
4457 | 4617 |
4458 NOTE: You may want to use gsi_replace on the iterator itself, | 4618 NOTE: You may want to use gsi_replace on the iterator itself, |
4459 as this performs additional bookkeeping that will not be done | 4619 as this performs additional bookkeeping that will not be done |
4460 if you simply assign through a pointer returned by gsi_stmt_ptr. */ | 4620 if you simply assign through a pointer returned by gsi_stmt_ptr. */ |
4461 | 4621 |
4462 static inline gimple * | 4622 static inline gimple * |