[rs4gc] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds
authorFangrui Song <i@maskray.me>
Sat, 6 Mar 2021 19:42:27 +0000 (11:42 -0800)
committerFangrui Song <i@maskray.me>
Sat, 6 Mar 2021 19:42:27 +0000 (11:42 -0800)
llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp

index fd92695..08e00bb 100644 (file)
@@ -834,11 +834,13 @@ static Value *findBasePointer(Value *I, DefiningValueMapTy &Cache) {
   // below.  This is important for deterministic compilation.
   MapVector<Value *, BDVState> States;
 
+#ifndef NDEBUG
   auto VerifyStates = [&]() {
     for (auto &Entry : States) {
       assert(Entry.first == Entry.second.getOriginalValue());
     }
   };
+#endif
 
   // Recursively fill in all base defining values reachable from the initial
   // one for which we don't already know a definite base value for