このページを編集する際は,編集に関する方針に従ってください.[]
概要[]
引数[]
- enum tree_code code
- tree type
- tree op0
- tree op1
- tree op2
- MEM_STAT_DECL
実装[]
10541 /* Fold a ternary tree expression with code CODE of type TYPE with
10542 operands OP0, OP1, and OP2. Return a folded expression if
10543 successful. Otherwise, return a tree expression with code CODE of
10544 type TYPE with operands OP0, OP1, and OP2. */
10545
10546 tree
10547 fold_build3_stat (enum tree_code code, tree type, tree op0, tree op1, tree op2
10548 MEM_STAT_DECL)
10549 {
10550 tree tem;
10551 #ifdef ENABLE_FOLD_CHECKING
10552 unsigned char checksum_before_op0[16],
10553 checksum_before_op1[16],
10554 checksum_before_op2[16],
10555 checksum_after_op0[16],
10556 checksum_after_op1[16],
10557 checksum_after_op2[16];
10558 struct md5_ctx ctx;
10559 htab_t ht;
10560
10561 ht = htab_create (32, htab_hash_pointer, htab_eq_pointer, NULL);
10562 md5_init_ctx (&ctx);
10563 fold_checksum_tree (op0, &ctx, ht);
10564 md5_finish_ctx (&ctx, checksum_before_op0);
10565 htab_empty (ht);
10566
10567 md5_init_ctx (&ctx);
10568 fold_checksum_tree (op1, &ctx, ht);
10569 md5_finish_ctx (&ctx, checksum_before_op1);
10570 htab_empty (ht);
10571
10572 md5_init_ctx (&ctx);
10573 fold_checksum_tree (op2, &ctx, ht);
10574 md5_finish_ctx (&ctx, checksum_before_op2);
10575 htab_empty (ht);
10576 #endif
10577
10578 tem = fold_ternary (code, type, op0, op1, op2);
10579 if (!tem)
10580 tem = build3_stat (code, type, op0, op1, op2 PASS_MEM_STAT);
10581
10582 #ifdef ENABLE_FOLD_CHECKING
10583 md5_init_ctx (&ctx);
10584 fold_checksum_tree (op0, &ctx, ht);
10585 md5_finish_ctx (&ctx, checksum_after_op0);
10586 htab_empty (ht);
10587
10588 if (memcmp (checksum_before_op0, checksum_after_op0, 16))
10589 fold_check_failed (op0, tem);
10590
10591 md5_init_ctx (&ctx);
10592 fold_checksum_tree (op1, &ctx, ht);
10593 md5_finish_ctx (&ctx, checksum_after_op1);
10594 htab_empty (ht);
10595
10596 if (memcmp (checksum_before_op1, checksum_after_op1, 16))
10597 fold_check_failed (op1, tem);
10598
10599 md5_init_ctx (&ctx);
10600 fold_checksum_tree (op2, &ctx, ht);
10601 md5_finish_ctx (&ctx, checksum_after_op2);
10602 htab_delete (ht);
10603
10604 if (memcmp (checksum_before_op2, checksum_after_op2, 16))
10605 fold_check_failed (op2, tem);
10606 #endif
10607 return tem;
10608 }