Rewrite how instances of passes are cloned
authorDavid Malcolm <dmalcolm@redhat.com>
Mon, 5 Aug 2013 20:25:06 +0000 (20:25 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Mon, 5 Aug 2013 20:25:06 +0000 (20:25 +0000)
commit8ac69a6c3230bd774a6f59f37b864a4bcee81c7c
tree9d7205fbfbfe412c67cbe7d39301e7de74e9581b
parent158922986553c3fe81df33b636bb8c8f1a38366e
Rewrite how instances of passes are cloned

gcc/

Rewrite how instances of passes are cloned to remove assumptions
about their sizes (thus allowing pass subclasses to have
additional data fields, albeit non-GC-managed ones at this point).

* passes.c (make_pass_instance): Now that passes have clone
methods, rewrite this function to eliminate XNEW and memcpy
calls that used hardcoded sizes.  Since this function no longer
creates pass instances, rename it to...
(add_pass_instance): ...this.  Document the old way that passes
were numbered and flagged, and rework this function to continue
using it.
(next_pass_1): Add an initial_pass argument for use by
add_pass_instance.
(position_pass): When adding multiple instances of a pass, use
the pass's clone method, rather than relying on the XNEW/memcpy
within the former make_pass_instance (now add_pass_instance).
(pass_manager::pass_manager): When invoking next_pass_1, also
supply the initial instance of the current pass within the
pass manager.

From-SVN: r201511
gcc/ChangeLog
gcc/passes.c