[llvm] 95db373 - [OpenMP] Silence unused variable warning in release builds

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 4 06:21:06 PDT 2022


Author: Benjamin Kramer
Date: 2022-09-04T15:19:48+02:00
New Revision: 95db37320d3c776e98e653c0761930b6636cd268

URL: https://github.com/llvm/llvm-project/commit/95db37320d3c776e98e653c0761930b6636cd268
DIFF: https://github.com/llvm/llvm-project/commit/95db37320d3c776e98e653c0761930b6636cd268.diff

LOG: [OpenMP] Silence unused variable warning in release builds

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp:3397:27: warning: unused variable 'SV' [-Werror]
  for (const llvm::Value *SV : StoreValues)
                            ^

Added: 
    

Modified: 
    llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
index f776cdeecac2..92f6289087e1 100644
--- a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+++ b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
@@ -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;


        


More information about the llvm-commits mailing list