[flang-commits] [flang] [MLIR, Flang, OpenMP] Remove usage of getElementType in OpenMPTranslation (PR #69772)

Markus Böck via flang-commits flang-commits at lists.llvm.org
Sat Oct 21 03:40:08 PDT 2023


================
@@ -156,6 +156,35 @@ struct AtomicReadOpConversion
   }
 };
 
+struct MapInfoOpConversion : public ConvertOpToLLVMPattern<omp::MapInfoOp> {
+  using ConvertOpToLLVMPattern<omp::MapInfoOp>::ConvertOpToLLVMPattern;
+  LogicalResult
+  matchAndRewrite(omp::MapInfoOp curOp, OpAdaptor adaptor,
+                  ConversionPatternRewriter &rewriter) const override {
+    const TypeConverter *converter = ConvertToLLVMPattern::getTypeConverter();
+
+    SmallVector<Type> resTypes;
+    if (failed(converter->convertTypes(curOp->getResultTypes(), resTypes)))
+      return failure();
+
+    // Copy attributes of the curOp except for the typeAttr which should
+    // be converted
+    SmallVector<NamedAttribute> newAttrs;
+    for (auto attr : curOp->getAttrs()) {
----------------
zero9178 wrote:

```suggestion
    for (NamedAttribute attr : curOp->getAttrs()) {
```
nit: expand the auto here

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


More information about the flang-commits mailing list