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

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 14:25:42 PST 2016


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 --------------
A non-text attachment was scrubbed...
Name: D16429.45596.patch
Type: text/x-patch
Size: 424 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160121/55f37c17/attachment.bin>


More information about the llvm-commits mailing list