[PATCH] D68447: [JITLink] Silence GCC warnings. NFC.
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 4 00:38:35 PDT 2019
mstorsjo created this revision.
mstorsjo added a reviewer: lhames.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
Use parentheses in expressions with mixed && and ||. Add unreachable for default cases in switch cases.
Repository:
rL LLVM
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
@@ -73,6 +73,8 @@
return "strong";
case Linkage::Weak:
return "weak";
+ default:
+ llvm_unreachable("Unrecognized linkage");
}
}
@@ -84,6 +86,8 @@
return "hidden";
case Scope::Local:
return "local";
+ default:
+ llvm_unreachable("Unrecognized scope");
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68447.223157.patch
Type: text/x-patch
Size: 1136 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191004/d3d423c2/attachment.bin>
More information about the llvm-commits
mailing list