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

via flang-commits flang-commits at lists.llvm.org
Wed Nov 29 07:42:25 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-flang-codegen

@llvm/pr-subscribers-flang-fir-hlfir

Author: None (jeanPerier)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/73808.diff


1 Files Affected:

- (modified) flang/lib/Optimizer/CodeGen/CodeGen.cpp (+3-3) 


``````````diff
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});

``````````

</details>


https://github.com/llvm/llvm-project/pull/73808


More information about the flang-commits mailing list