Skip to content

Commit 50acc6d

Browse files
committed
[flang][fir] Add missing HasParent in fir_DTEntryOp
Differential Revision: https://reviews.llvm.org/D113674
1 parent be56ece commit 50acc6d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

flang/include/flang/Optimizer/Dialect/FIROps.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2870,7 +2870,7 @@ def fir_DispatchTableOp : fir_Op<"dispatch_table",
28702870
}];
28712871
}
28722872

2873-
def fir_DTEntryOp : fir_Op<"dt_entry", []> {
2873+
def fir_DTEntryOp : fir_Op<"dt_entry", [HasParent<"DispatchTableOp">]> {
28742874
let summary = "map entry in a dispatch table";
28752875

28762876
let description = [{

flang/test/Fir/convert-to-llvm-invalid.fir

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,10 @@ func @gentypedesc() {
9393
%0 = fir.gentypedesc !fir.type<derived3>
9494
return
9595
}
96+
97+
// -----
98+
99+
// Verify that `fir.dt_entry` requires a parent op
100+
101+
// expected-error@+1{{'fir.dt_entry' op expects parent op 'fir.dispatch_table'}}
102+
fir.dt_entry "method", @method_impl

0 commit comments

Comments
 (0)