forked from OSchip/llvm-project
[fir] Add !fir.ptr type conversion
This patch is part of the upstreaming effort for fir-dev. Differential Revision: https://reviews.llvm.org/D113559 Co-authored-by: Jean Perier <jperier@nvidia.com>
This commit is contained in:
parent
aaea92e1cd
commit
deafc6fc6d
|
@ -41,6 +41,8 @@ public:
|
||||||
return mlir::IntegerType::get(
|
return mlir::IntegerType::get(
|
||||||
&getContext(), kindMapping.getLogicalBitsize(boolTy.getFKind()));
|
&getContext(), kindMapping.getLogicalBitsize(boolTy.getFKind()));
|
||||||
});
|
});
|
||||||
|
addConversion(
|
||||||
|
[&](fir::PointerType pointer) { return convertPointerLike(pointer); });
|
||||||
addConversion(
|
addConversion(
|
||||||
[&](fir::RecordType derived) { return convertRecordType(derived); });
|
[&](fir::RecordType derived) { return convertRecordType(derived); });
|
||||||
addConversion(
|
addConversion(
|
||||||
|
|
|
@ -31,6 +31,18 @@ func private @foo1(%arg0: !fir.ref<!fir.array<10xf32>>)
|
||||||
|
|
||||||
// -----
|
// -----
|
||||||
|
|
||||||
|
// 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`
|
// Test box types `!fir.box`
|
||||||
|
|
||||||
func private @foo0(%arg0: !fir.box<!fir.array<?xf32>>)
|
func private @foo0(%arg0: !fir.box<!fir.array<?xf32>>)
|
||||||
|
|
Loading…
Reference in New Issue