[PATCH] D16429: [gold] Remove inconsistent llvm_unreachable()

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 22 12:37:35 PST 2016


It might be there to avoid a warning.

LGTM if no warnings with GCC or clang.

Cheers,
Rafael
On Jan 21, 2016 5:25 PM, "Davide Italiano" <dccitaliano at gmail.com> wrote:

> davide created this revision.
> davide added reviewers: rafael, joker.eph.
> davide added a subscriber: llvm-commits.
>
> message(LDPL_FATAL, ...) should never return. This is the only place in
> the gold-plugin code where we put an unreachable() after that to ensure the
> invariant is satisfied. I think that we can either add llvm_unreachable()
> after each use of LDPL_FATAL in the source file, or remove this one.
> I just don't like the inconsistency, so I vote for the removal.
>
> http://reviews.llvm.org/D16429
>
> Files:
>   tools/gold/gold-plugin.cpp
>
> Index: tools/gold/gold-plugin.cpp
> ===================================================================
> --- tools/gold/gold-plugin.cpp
> +++ tools/gold/gold-plugin.cpp
> @@ -344,7 +344,6 @@
>    case DS_Error:
>      message(LDPL_FATAL, "LLVM gold plugin has failed to create LTO
> module: %s",
>              ErrStorage.c_str());
> -    llvm_unreachable("Fatal doesn't return.");
>    case DS_Warning:
>      Level = LDPL_WARNING;
>      break;
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160122/c9b91ef7/attachment.html>


More information about the llvm-commits mailing list