From c20cb5547ddde565c4fd69900ef7d71371e51611 Mon Sep 17 00:00:00 2001 From: Frederik Gossen Date: Thu, 19 Aug 2021 12:51:14 +0200 Subject: [PATCH] Avoid unused variable when NDEBUG --- llvm/lib/ExecutionEngine/JITLink/x86_64.cpp | 2 ++ 1 file changed, 2 insertions(+) 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( const_cast(B->getContent().data())) + E.getOffset();