public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Cary Coutant <ccoutant@google.com>
To: Rafael Espindola <espindola@google.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	Diego Novillo <dnovillo@google.com>
Subject: Re: [patch] Use LDPL_FATAL instead of assert
Date: Thu, 15 Oct 2009 21:58:00 -0000	[thread overview]
Message-ID: <c17be2b30910151453p32169188g2fda9fe6d2203e65@mail.gmail.com> (raw)
In-Reply-To: <38a0d8450910151133o563baec6qcd685a9ba1eceb70@mail.gmail.com>

> The plugin currently asserts on all errors. This patch changes most of them
> into calls to the message callback. The patch also makes the cleanup_handler
> succeed when being called in consequence of an earlier error.
>
> 2009-10-15  Rafael Avila de Espindola  <espindola@google.com>
>
>        * lto-plugin.c (message): New variable.
>        (check): New function.
>        (parse_table_entry, translate, write_resolution,add_output_files,
>        exec_lto_wrapper,claim_file_handler, onload): Use check instead of
>        assert.
>        (cleanup_handler): Use check instead of assert. Remove the arguments
>        file if it exists.

+  check (WIFEXITED (status) && WEXITSTATUS (status) == 0,
+	 LDPL_FATAL,          "lto-wrapper failed.");

There's a bunch of extraneous spaces here.

+  /* Note: we cannot use LDPL_FATAL in here as that would produce
+     an infinite loop. */

Good point! That should probably be documented in the header and the
wiki page. (Hope you didn't discover that the hard way!)

+  check (version != EV_NONE, LDPL_FATAL, "Invalid elf version.");

"elf" should be "ELF".

Other than Joseph's comment about message style (and provided it's OK
to defer the I18N stuff), the rest looks good.

-cary

  parent reply	other threads:[~2009-10-15 21:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-15 18:41 Rafael Espindola
2009-10-15 21:10 ` Joseph S. Myers
2009-10-15 21:50   ` Cary Coutant
2009-10-15 21:54     ` Joseph S. Myers
2009-10-17  1:22       ` Ian Lance Taylor
2009-10-16 15:53     ` Rafael Espindola
2009-10-15 21:58 ` Cary Coutant [this message]
2009-10-15 23:24   ` Cary Coutant
2009-10-16  5:15   ` Joseph S. Myers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c17be2b30910151453p32169188g2fda9fe6d2203e65@mail.gmail.com \
    --to=ccoutant@google.com \
    --cc=dnovillo@google.com \
    --cc=espindola@google.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).