[flang-commits] [flang] 57c639d - [flang][openacc] Fix -Wunused-variable in OpenACC.cpp (NFC)

Jie Fu via flang-commits flang-commits at lists.llvm.org
Mon Oct 2 18:16:42 PDT 2023


Author: Jie Fu
Date: 2023-10-03T09:14:32+08:00
New Revision: 57c639deb49c6cfe659e6551d15bef9151411a18

URL: https://github.com/llvm/llvm-project/commit/57c639deb49c6cfe659e6551d15bef9151411a18
DIFF: https://github.com/llvm/llvm-project/commit/57c639deb49c6cfe659e6551d15bef9151411a18.diff

LOG: [flang][openacc] Fix -Wunused-variable in OpenACC.cpp (NFC)

/llvm-project/flang/lib/Lower/OpenACC.cpp:940:16: error: unused variable 'nbRangeArgs' [-Werror,-Wunused-variable]
      unsigned nbRangeArgs =
               ^
1 error generated.

Added: 
    

Modified: 
    flang/lib/Lower/OpenACC.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Lower/OpenACC.cpp b/flang/lib/Lower/OpenACC.cpp
index d81cb491c992ad3..57dd0fab2b9c69a 100644
--- a/flang/lib/Lower/OpenACC.cpp
+++ b/flang/lib/Lower/OpenACC.cpp
@@ -937,7 +937,7 @@ static void genCombiner(fir::FirOpBuilder &builder, mlir::Location loc,
       }
     } else {
       // Lowerbound, upperbound and step are passed as block arguments.
-      unsigned nbRangeArgs =
+      [[maybe_unused]] unsigned nbRangeArgs =
           recipe.getCombinerRegion().getArguments().size() - 2;
       assert((nbRangeArgs / 3 == seqTy.getDimension()) &&
              "Expect 3 block arguments per dimension");


        


More information about the flang-commits mailing list