[flang-commits] [PATCH] D113559: [fir] Add !fir.ptr type conversion
Diana Picus via Phabricator via flang-commits
flang-commits at lists.llvm.org
Wed Nov 10 04:29:06 PST 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rGdeafc6fc6de6: [fir] Add !fir.ptr type conversion (authored by rovka).
Changed prior to commit:
https://reviews.llvm.org/D113559?vs=386117&id=386121#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113559/new/
https://reviews.llvm.org/D113559
Files:
flang/lib/Optimizer/CodeGen/TypeConverter.h
flang/test/Fir/types-to-llvm.fir
Index: flang/test/Fir/types-to-llvm.fir
===================================================================
--- flang/test/Fir/types-to-llvm.fir
+++ flang/test/Fir/types-to-llvm.fir
@@ -31,6 +31,18 @@
// -----
+// Test pointer types `!fir.ptr`
+
+func private @foo0(%arg0: !fir.ptr<i32>)
+// CHECK-LABEL: foo0
+// CHECK-SAME: !llvm.ptr<i32>
+
+func private @foo1(%arg0: !fir.ptr<!fir.array<10xf32>>)
+// CHECK-LABEL: foo1
+// CHECK-SAME: !llvm.ptr<array<10 x f32>>
+
+// -----
+
// Test box types `!fir.box`
func private @foo0(%arg0: !fir.box<!fir.array<?xf32>>)
Index: flang/lib/Optimizer/CodeGen/TypeConverter.h
===================================================================
--- flang/lib/Optimizer/CodeGen/TypeConverter.h
+++ flang/lib/Optimizer/CodeGen/TypeConverter.h
@@ -41,6 +41,8 @@
return mlir::IntegerType::get(
&getContext(), kindMapping.getLogicalBitsize(boolTy.getFKind()));
});
+ addConversion(
+ [&](fir::PointerType pointer) { return convertPointerLike(pointer); });
addConversion(
[&](fir::RecordType derived) { return convertRecordType(derived); });
addConversion(
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113559.386121.patch
Type: text/x-patch
Size: 1149 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20211110/c19dd487/attachment.bin>
More information about the flang-commits
mailing list