[flang-commits] [flang] [llvm] Fixing the location attribute added to mapInfoOp (PR #90764)

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Wed May 8 03:35:02 PDT 2024


================
@@ -903,9 +903,12 @@ bool ClauseProcessor::processMap(
           // Explicit map captures are captured ByRef by default,
           // optimisation passes may alter this to ByCopy or other capture
           // types to optimise
+          auto location = mlir::NameLoc::get(
+              mlir::StringAttr::get(firOpBuilder.getContext(), asFortran.str()),
+              symAddr.getLoc());
           mlir::Value mapOp = createMapInfoOp(
-              firOpBuilder, clauseLocation, symAddr, mlir::Value{},
-              asFortran.str(), bounds, {},
+              firOpBuilder, location, symAddr, mlir::Value{}, asFortran.str(),
+              bounds, {},
----------------
skatrak wrote:

Nit: Add comments to document hardcoded arguments, same comment for the other call to `createMapInfoOp` in OpenMP.cpp.
```suggestion
              firOpBuilder, location, symAddr, /*varPtrPtr=*/mlir::Value{}, asFortran.str(),
              bounds, /*members=*/{},
```

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


More information about the flang-commits mailing list