Share code from fold_array_ctor_reference with fold.
authorAlan Lawrence <alan.lawrence@arm.com>
Fri, 30 Oct 2015 19:03:14 +0000 (19:03 +0000)
committerAlan Lawrence <alalaw01@gcc.gnu.org>
Fri, 30 Oct 2015 19:03:14 +0000 (19:03 +0000)
commit6a6360148aac759fe9fffbbf57e914d281509d72
tree048ba4fc557bff29b1270bd479190d404999156b
parent3b1661a9b93fe8000faa6ab4b721a96ffb48d525
Share code from fold_array_ctor_reference with fold.

        * gimple-fold.c (fold_array_ctor_reference): Move searching code to:
        * fold-const.c (get_array_ctor_element_at_index): New.
        (fold): Remove binary-search through CONSTRUCTOR, call previous.

        * fold-const.h (get_array_ctor_element_at_index): New.

From-SVN: r229605
gcc/ChangeLog
gcc/fold-const.c
gcc/fold-const.h
gcc/gimple-fold.c