[PATCH] D68447: [JITLink] Silence GCC warnings. NFC.

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 4 01:48:16 PDT 2019


mstorsjo updated this revision to Diff 223171.
mstorsjo edited the summary of this revision.
mstorsjo added a comment.

Tweak the use of unreachable, to avoid warnings when built with clang.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68447/new/

https://reviews.llvm.org/D68447

Files:
  llvm/lib/ExecutionEngine/JITLink/JITLink.cpp
  llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h


Index: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h
===================================================================
--- llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h
+++ llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h
@@ -107,7 +107,7 @@
                      uint8_t Sect, uint16_t Desc, Linkage L, Scope S)
         : Name(Name), Value(Value), Type(Type), Sect(Sect), Desc(Desc), L(L),
           S(S) {
-      assert(!Name || !Name->empty() && "Name must be none or non-empty");
+      assert((!Name || !Name->empty()) && "Name must be none or non-empty");
     }
 
   public:
Index: llvm/lib/ExecutionEngine/JITLink/JITLink.cpp
===================================================================
--- llvm/lib/ExecutionEngine/JITLink/JITLink.cpp
+++ llvm/lib/ExecutionEngine/JITLink/JITLink.cpp
@@ -74,6 +74,7 @@
   case Linkage::Weak:
     return "weak";
   }
+  llvm_unreachable("Unrecognized linkage");
 }
 
 const char *getScopeName(Scope S) {
@@ -85,6 +86,7 @@
   case Scope::Local:
     return "local";
   }
+  llvm_unreachable("Unrecognized scope");
 }
 
 raw_ostream &operator<<(raw_ostream &OS, const Block &B) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68447.223171.patch
Type: text/x-patch
Size: 1161 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191004/352b322b/attachment.bin>


More information about the llvm-commits mailing list