PATCH RFA: Use vectors in the C++ frontend
Ian Lance Taylor
iant@google.com
Wed May 20 18:16:00 GMT 2009
Ping.
http://gcc.gnu.org/ml/gcc-patches/2009-04/msg02308.html
Original patch description:
> Jason asked me to look into using vectors in the C++ frontend.
> Currently the C++ parser builds tree list nodes for function arguments.
> It then immediately generates a CALL_EXPR node, which holds all the
> function arguments directly. In other words, the tree list nodes become
> garbage almost immediately.
> This patch changes the frontend to store function arguments in vectors
> instead. This is a fairly extensive patch, as changing the handling of
> function arguments affects function overload resolution. The bulk of
> this patch is simply pushing vectors all the way through function calls,
> and then changing all the various bits of code which can call function
> to produce vectors. The vectors created by the parser are cached to
> minimize the overhead of memory allocation and deallocation. This patch
> could be extended to use that cache elsewhere in the frontend as well,
> but I didn't do that.
> According to -fmem-report with --enable-gather-detailed-mem-stats, when
> compiling tramp3d, this patch reduces the number of "random kinds" of
> tree nodes, which include tree lists, by just over 10%. It reduces the
> total memory allocated for all tree nodes by just over 2%. It reduces
> total memory allocation by just over 0.5%.
> This patch has been bootstrapped and tested with c/c++/objc/obj-c++ on
> i686-pc-linux-gnu. OK for mainline?
Ian
More information about the Gcc-patches
mailing list