[flang-commits] [flang] 740f14e - [flang] fix codegen warning from #73641 (#73808)

via flang-commits flang-commits at lists.llvm.org
Wed Nov 29 09:00:45 PST 2023


Author: jeanPerier
Date: 2023-11-29T18:00:40+01:00
New Revision: 740f14edb4f2bf836b8892dd772ed1d52d24288d

URL: https://github.com/llvm/llvm-project/commit/740f14edb4f2bf836b8892dd772ed1d52d24288d
DIFF: https://github.com/llvm/llvm-project/commit/740f14edb4f2bf836b8892dd772ed1d52d24288d.diff

LOG: [flang] fix codegen warning from #73641 (#73808)

Added: 
    

Modified: 
    flang/lib/Optimizer/CodeGen/CodeGen.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Optimizer/CodeGen/CodeGen.cpp b/flang/lib/Optimizer/CodeGen/CodeGen.cpp
index 38227f5c02a7ca5..408377f1d7a1762 100644
--- a/flang/lib/Optimizer/CodeGen/CodeGen.cpp
+++ b/flang/lib/Optimizer/CodeGen/CodeGen.cpp
@@ -3667,9 +3667,9 @@ struct BoxOffsetOpConversion : public FIROpConversion<fir::BoxOffsetOp> {
     mlir::Type boxType = fir::unwrapRefType(boxOffset.getBoxRef().getType());
     mlir::Type llvmBoxTy =
         lowerTy().convertBoxTypeAsStruct(mlir::cast<fir::BaseBoxType>(boxType));
-    unsigned fieldId = boxOffset.getField() == fir::BoxFieldAttr::derived_type
-                           ? getTypeDescFieldId(boxType)
-                           : kAddrPosInBox;
+    int fieldId = boxOffset.getField() == fir::BoxFieldAttr::derived_type
+                      ? getTypeDescFieldId(boxType)
+                      : kAddrPosInBox;
     rewriter.replaceOpWithNewOp<mlir::LLVM::GEPOp>(
         boxOffset, pty, llvmBoxTy, adaptor.getBoxRef(),
         llvm::ArrayRef<mlir::LLVM::GEPArg>{0, fieldId});


        


More information about the flang-commits mailing list