[flang-commits] [flang] 76c3c5b - [flang] [stack-arrays] fix unused variable warning

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Mon Jun 5 08:37:16 PDT 2023


Author: Tom Eccles
Date: 2023-06-05T15:36:02Z
New Revision: 76c3c5bca0440fea7560f97a6b7244094c67276c

URL: https://github.com/llvm/llvm-project/commit/76c3c5bca0440fea7560f97a6b7244094c67276c
DIFF: https://github.com/llvm/llvm-project/commit/76c3c5bca0440fea7560f97a6b7244094c67276c.diff

LOG: [flang] [stack-arrays] fix unused variable warning

Added: 
    

Modified: 
    flang/lib/Optimizer/Transforms/StackArrays.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Optimizer/Transforms/StackArrays.cpp b/flang/lib/Optimizer/Transforms/StackArrays.cpp
index d22ae490a69da..bd233b38387bf 100644
--- a/flang/lib/Optimizer/Transforms/StackArrays.cpp
+++ b/flang/lib/Optimizer/Transforms/StackArrays.cpp
@@ -476,7 +476,8 @@ static mlir::Value convertAllocationType(mlir::PatternRewriter &rewriter,
     return stack;
 
   fir::HeapType firHeapTy = mlir::cast<fir::HeapType>(heapTy);
-  fir::ReferenceType firRefTy = mlir::cast<fir::ReferenceType>(stackTy);
+  LLVM_ATTRIBUTE_UNUSED fir::ReferenceType firRefTy =
+      mlir::cast<fir::ReferenceType>(stackTy);
   assert(firHeapTy.getElementType() == firRefTy.getElementType() &&
          "Allocations must have the same type");
 


        


More information about the flang-commits mailing list