[PATCH 02/16] gcc: Embed the driver in-process within libgccjit
Bert Wesarg
bert.wesarg@googlemail.com
Wed Jun 3 06:00:00 GMT 2015
On Mon, Jun 1, 2015 at 11:04 PM, David Malcolm <dmalcolm@redhat.com> wrote:
> Provide a way to clean up state within the driver code, and use this
> from libgccjit to embed it in-process, rather that via pex. Part of
> this requires restoring the environment after any putenv calls, so the
> patch introduces an env_manager class. No effort is made to restore
> the environment for the classic use-case.
>
> This embedding gives a slight performance win for
> jit.dg/test-benchmark.c, and enables bigger performance gains in
> followup patches.
>
> I've fixed the worst of the memory leaks, but this does still
> leak somewhat.
>
> gcc/ChangeLog:
> * gcc-main.c (main): Add params to driver ctor.
> * gcc.c (class env_manager): New.
> (env): New global.
> (env_manager::init): New.
> (env_manager::getenv): New.
> (env_manager::xputenv): New.
> (env_manager::restore): New.
> Poison genenv and putenv.
getenv? The same applies to the actual #pragma statement.
Bert
More information about the Binutils
mailing list