[llvm] c20cb55 - Avoid unused variable when NDEBUG
Frederik Gossen via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 19 04:00:35 PDT 2021
Author: Frederik Gossen
Date: 2021-08-19T13:00:16+02:00
New Revision: c20cb5547ddde565c4fd69900ef7d71371e51611
URL: https://github.com/llvm/llvm-project/commit/c20cb5547ddde565c4fd69900ef7d71371e51611
DIFF: https://github.com/llvm/llvm-project/commit/c20cb5547ddde565c4fd69900ef7d71371e51611.diff
LOG: Avoid unused variable when NDEBUG
Added:
Modified:
llvm/lib/ExecutionEngine/JITLink/x86_64.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ExecutionEngine/JITLink/x86_64.cpp b/llvm/lib/ExecutionEngine/JITLink/x86_64.cpp
index a95b34bcce70..c2e25c6c685e 100644
--- a/llvm/lib/ExecutionEngine/JITLink/x86_64.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/x86_64.cpp
@@ -76,9 +76,11 @@ Error optimize_x86_64_GOTAndStubs(LinkGraph &G) {
for (auto &E : B->edges()) {
if (E.getKind() == x86_64::PCRel32GOTLoadRelaxable ||
E.getKind() == x86_64::PCRel32GOTLoadREXRelaxable) {
+#ifndef NDEBUG
bool REXPrefix = E.getKind() == x86_64::PCRel32GOTLoadREXRelaxable;
assert(E.getOffset() >= (REXPrefix ? 3 : 2) &&
"GOT edge occurs too early in block");
+#endif
auto *FixupData = reinterpret_cast<uint8_t *>(
const_cast<char *>(B->getContent().data())) +
E.getOffset();
More information about the llvm-commits
mailing list