Avoid unused variable when NDEBUG
authorFrederik Gossen <frgossen@google.com>
Thu, 19 Aug 2021 10:51:14 +0000 (12:51 +0200)
committerFrederik Gossen <frgossen@google.com>
Thu, 19 Aug 2021 11:00:16 +0000 (13:00 +0200)
llvm/lib/ExecutionEngine/JITLink/x86_64.cpp

index a95b34b..c2e25c6 100644 (file)
@@ -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();