Introduce gpredict subclass and use it for all gimple_predict_ accessors
commit6929530c31ab3090b77ba9ee1e6c1c26ffe6ce27
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 29 Oct 2014 18:06:31 +0000 (29 14:06 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Wed, 29 Oct 2014 18:06:31 +0000 (29 14:06 -0400)
treefc84ad26abd7c532e060374a16d277169b6777c2
parent1ec4ecdc58006a4343068334a386596fda09c361
Introduce gpredict subclass and use it for all gimple_predict_ accessors

gcc/ChangeLog.gimple-classes:
* coretypes.h (struct gpredict): Add forward declaration.
* doc/gimple.texi (Class hierarchy of GIMPLE statements): Add
gpredict.
* gimple-pretty-print.c (pp_gimple_stmt_1): Within case
GIMPLE_PREDICT, add local "predict_stmt" via a checked cast and
use it in place of "stmt".
* gimple.c (gimple_build_predict): Strengthen return type and
local "p" from gimple to gpredict *.
* gimple.h (struct gpredict): New subclass of
gimple_statement_base, adding invariant that code is
GIMPLE_PREDICT.
(is_a_helper <gpredict *>::test): New.
(gimple_build_predict): Strengthen return type from gimple to
gpredict *.
(gimple_predict_predictor): Strengthen param from const_gimple to
const gpredict *.
(gimple_predict_outcome): Likewise.
(gimple_predict_set_predictor): Strengthen param from gimple to
gpredict *.
(gimple_predict_set_outcome): Likewise.
* predict.c (tree_bb_level_predictions): Convert check for
GIMPLE_PREDICT to a dyn_cast, introducing local "predict_stmt" and
using it in place of "stmt" for typesafety.
gcc/ChangeLog.gimple-classes
gcc/coretypes.h
gcc/doc/gimple.texi
gcc/gimple-pretty-print.c
gcc/gimple.c
gcc/gimple.h
gcc/predict.c