[flang-commits] [flang] 8b3c071 - [Flang][OpenMP] Small fix to handle CharBoxValue types for implicit target maps

Akash Banerjee via flang-commits flang-commits at lists.llvm.org
Mon Nov 6 08:50:16 PST 2023


Author: Akash Banerjee
Date: 2023-11-06T16:50:09Z
New Revision: 8b3c071b6f0f20a911aa83be00f4863a30da159b

URL: https://github.com/llvm/llvm-project/commit/8b3c071b6f0f20a911aa83be00f4863a30da159b
DIFF: https://github.com/llvm/llvm-project/commit/8b3c071b6f0f20a911aa83be00f4863a30da159b.diff

LOG: [Flang][OpenMP] Small fix to handle CharBoxValue types for implicit target maps

Original commit: fbaf2c6cf7b207145dbda0d1cbadd0b446a21199
Original PR: #67164

Added: 
    

Modified: 
    flang/lib/Lower/OpenMP.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Lower/OpenMP.cpp b/flang/lib/Lower/OpenMP.cpp
index 087f535ff06408b..12709b0b07563e8 100644
--- a/flang/lib/Lower/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP.cpp
@@ -2527,12 +2527,13 @@ static void genBodyOfTargetOp(
         [&](const fir::CharArrayBoxValue &v) {
           converter.bindSymbol(
               *sym,
-              fir::CharArrayBoxValue(arg, v.getLen(),
+              fir::CharArrayBoxValue(arg, extractBoundArgs(1).front(),
                                      extractBoundArgs(v.getExtents().size()),
                                      extractBoundArgs(v.getLBounds().size())));
         },
         [&](const fir::CharBoxValue &v) {
-          converter.bindSymbol(*sym, fir::CharBoxValue(arg, v.getLen()));
+          converter.bindSymbol(
+              *sym, fir::CharBoxValue(arg, extractBoundArgs(1).front()));
         },
         [&](const fir::UnboxedValue &v) { converter.bindSymbol(*sym, arg); },
         [&](const auto &) {
@@ -2696,9 +2697,17 @@ genTargetOp(Fortran::lower::AbstractConverter &converter,
           addMapInfoForBounds(v.getLBounds());
         },
         [&](const fir::CharArrayBoxValue &v) {
+          llvm::SmallVector<mlir::Value> len;
+          len.push_back(v.getLen());
+          addMapInfoForBounds(len);
           addMapInfoForBounds(v.getExtents());
           addMapInfoForBounds(v.getLBounds());
         },
+        [&](const fir::CharBoxValue &v) {
+          llvm::SmallVector<mlir::Value> len;
+          len.push_back(v.getLen());
+          addMapInfoForBounds(len);
+        },
         [&](const auto &) {
           // Nothing to do for non-box values.
         });


        


More information about the flang-commits mailing list