[OpenMP] Silence unused variable warning in release builds
authorBenjamin Kramer <benny.kra@googlemail.com>
Sun, 4 Sep 2022 13:19:48 +0000 (15:19 +0200)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sun, 4 Sep 2022 13:19:48 +0000 (15:19 +0200)
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp:3397:27: warning: unused variable 'SV' [-Werror]
  for (const llvm::Value *SV : StoreValues)
                            ^

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

index f776cde..92f6289 100644 (file)
@@ -3394,9 +3394,10 @@ OpenMPIRBuilder::createOrderedDepend(const LocationDescription &Loc,
                                      InsertPointTy AllocaIP, unsigned NumLoops,
                                      ArrayRef<llvm::Value *> StoreValues,
                                      const Twine &Name, bool IsDependSource) {
-  for (const llvm::Value *SV : StoreValues)
-    assert(SV->getType()->isIntegerTy(64) &&
-           "OpenMP runtime requires depend vec with i64 type");
+  assert(
+      llvm::all_of(StoreValues,
+                   [](Value *SV) { return SV->getType()->isIntegerTy(64); }) &&
+      "OpenMP runtime requires depend vec with i64 type");
 
   if (!updateToLocation(Loc))
     return Loc.IP;