[lto][patch] Call lto-wrapper from the plugin

Diego Novillo dnovillo@google.com
Tue Dec 2 13:17:00 GMT 2008


2008/12/1 Rafael Espindola <espindola@google.com>:

>    free (claimed_files);
>    claimed_files = NULL;
>    num_claimed_files = 0;
> @@ -259,8 +272,13 @@ static void
>  write_resolution(void)

Space before '('.

> +    {
> +      size_t len;
> +      char *s =fgets (fname, sizeof (fname), f);

Space after '='.

> +
> +  pid= fork ();

Space before '='.

> +  assert (pid >= 0);

Add some comments to what the child and parent are supposed to do here.

> +  if (pid == 0)
> +    {
> +      t = close (1);
> +      assert (t == 0);
> +      t = close (pipe_read);
> +      assert (t == 0);
> +      t = dup2(pipe_write, 1);

Space before '('.

> +static void
> +process_option (const char *option)
> +{
> +  unsigned i;
> +  char *p;
> +
> +  assert (strncmp("lto=", option, 4) == 0);

Space before '('.

> +  p = strdup(option + 4);

Likewise.

> +  lto_wrapper_num_args = 1;
> +  for (i = 0; p[i] != '\0'; i++)
> +    if (p[i] == ' ')
> +      lto_wrapper_num_args++;
> +
> +  lto_wrapper_argv = (char **) calloc (sizeof (char *), lto_wrapper_num_args);
> +  char **lto_arg_ptr = (char **) lto_wrapper_argv;

Declarations mixed with code here.

OK with those changes.


Diego.



More information about the Gcc-patches mailing list