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

Markus Böck llvmlistbot at llvm.org
Sat Oct 21 03:40:09 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 Mlir-commits mailing list