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

via llvm-commits llvm-commits at lists.llvm.org
Wed May 1 19:40:03 PDT 2024


================
@@ -1644,11 +1644,14 @@ genTargetOp(Fortran::lower::AbstractConverter &converter,
         } else if (!fir::isa_builtin_cptr_type(eleType)) {
           mapFlag |= llvm::omp::OpenMPOffloadMappingFlags::OMP_MAP_TO;
           mapFlag |= llvm::omp::OpenMPOffloadMappingFlags::OMP_MAP_FROM;
-        }
-
+        };
+        auto context = converter.getFirOpBuilder().getContext();
----------------
agozillon wrote:

Very minor nit (that I myself accidentally do all the time): should perhaps change the auto to the context's type (an MLIRContext I think) and perhaps use the firOpBuilder variable that exists already if it's possible as opposed to getting it through the converter! Or alternatively you could change the argument "context" given to NameLoc::get to "firOpBuilder.getContext()". The same applies to the above in the other function motionClauses that one day soon will be aligned as it's for the most part identical! 

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


More information about the llvm-commits mailing list