Introduce gimple_transaction
commitd13f61c244285c84f1f3f7eda2f03c7e63410b6f
authorDavid Malcolm <dmalcolm@redhat.com>
Mon, 16 Dec 2013 16:02:54 +0000 (16 11:02 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Fri, 24 Oct 2014 21:24:04 +0000 (24 17:24 -0400)
tree9f5047eaa16d9bcc463373170787f43e3fabbc69
parent0cc051f8c5c69db8ca5f1a759e620453aa4bce04
Introduce gimple_transaction

This corresponds to:
  [PATCH 24/89] Introduce gimple_transaction
  https://gcc.gnu.org/ml/gcc-patches/2014-04/msg01207.html
from the original 89-patch kit

That earlier patch was approved by Jeff:
> OK after fixing up the naming/const stuff as discussed for prior
> patches.
> That applies to 22-30. Make sure to take care of
> the pretty printers per Trevor's comments as well. He indicated those
> were missing in a couple of those patches.
in https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00628.html

gcc/
* coretypes.h (gimple_transaction): New typedef.
(const_gimple_transaction): New typedef.

* gimple.h (gimple_build_transaction): Return a gimple_transaction
rather than a plain gimple.
(gimple_transaction_body_ptr): Require a gimple_transaction rather
than a plain gimple.
(gimple_transaction_body): Likewise.
(gimple_transaction_label_ptr): Likewise.
(gimple_transaction_set_body): Likewise.
(gimple_transaction_set_label): Likewise.
(gimple_transaction_set_subcode): Likewise.
(gimple_transaction_label): Require a const_gimple_transaction
rather than a plain const_gimple.
(gimple_transaction_subcode): Likewise.

* gimple-low.c (lower_stmt): Add checked cast to
gimple_transaction within GIMPLE_TRANSACTION case of switch
statement.

* gimple-pretty-print.c (dump_gimple_transaction): Require a
gimple_transaction rather than a plain gimple.
(pp_gimple_stmt_1): Add checked cast to gimple_transaction within
GIMPLE_TRANSACTION case of switch statement.
* gimple-streamer-in.c (input_gimple_stmt): Likewise.
* gimple-streamer-out.c (output_gimple_stmt): Likewise.
* gimple-walk.c (walk_gimple_op): Likewise.
(walk_gimple_stmt): Likewise.

* gimple.c (gimple_build_transaction): Return a gimple_transaction
rather than a plain gimple.
(gimple_copy): Add checked casts to gimple_transaction within
GIMPLE_TRANSACTION case of switch statement.

* gimplify.c (gimplify_transaction): Split local "g" into
"body_stmt" and "trans_stmt", strengthening the type of the latter
from gimple to gimple_transaction.

* omp-low.c (lower_omp_1): Add checked cast to gimple_transaction
within GIMPLE_TRANSACTION case of switch statement.

* trans-mem.c (diagnose_tm_1): Add checked cast within
GIMPLE_TRANSACTION case of switch statement, introducing a new
local "trans_stmt".  Use it in place of "stmt".
(examine_call_tm): Convert local from gimple to gimple_transaction.
(tm_region::get_transaction_stmt): New method.
(tm_region::transaction_stmt): Add clarification of type to the
comment.
(tm_region_init_0): Require a gimple_transaction rather than a
plain gimple.
(tm_region_init): Convert a check against GIMPLE_TRANSACTION to a
dyn_cast<gimple_transaction> and new local.
(transaction_subcode_ior): Add a new local, using the new
get_transaction_stmt method to perform a checked cast.
(propagate_tm_flags_out): Likewise.
(expand_transaction): Add a checked cast using the new
get_transaction_stmt method.
(generate_tm_state): Likewise.
(execute_tm_mark): Likewise.
(ipa_tm_diagnose_transaction): Likewise.

* tree-cfg.c (verify_gimple_transaction): Require a
gimple_transaction rather than a plain gimple.
(make_edges): Add checked cast within GIMPLE_TRANSACTION case of
switch statement
(cleanup_dead_labels): Likewise.
(verify_gimple_stmt): Likewise.
(verify_gimple_in_seq_2): Likewise.
(verify_gimple_in_seq_2): Likewise.
(gimple_redirect_edge_and_branch): Add checked cast.

* tree-inline.c (remap_gimple_stmt): Add checked cast within
GIMPLE_TRANSACTION case of switch statement, introducing a new
local "old_trans_stmt".  Use it in place of "stmt".  Add new
local "new_trans_stmt", using it to initialize "copy", and for
type-safe operations as a transaction.
(estimate_num_insns): Add checked cast within GIMPLE_TRANSACTION
case of switch statement.
14 files changed:
gcc/ChangeLog.gimple-classes
gcc/coretypes.h
gcc/gimple-low.c
gcc/gimple-pretty-print.c
gcc/gimple-streamer-in.c
gcc/gimple-streamer-out.c
gcc/gimple-walk.c
gcc/gimple.c
gcc/gimple.h
gcc/gimplify.c
gcc/omp-low.c
gcc/trans-mem.c
gcc/tree-cfg.c
gcc/tree-inline.c