Skip to content

Commit 1b352f6

Browse files
committed
Fail with some grace on pointer assignments
1 parent 1456802 commit 1b352f6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

flang/lib/Lower/OpenMP/OpenMP.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,16 @@ markDeclareTarget(mlir::Operation *op, lower::AbstractConverter &converter,
11251125
declareTargetOp.setDeclareTarget(deviceType, captureClause);
11261126
}
11271127

1128+
static bool isPointerAssignment(const evaluate::Assignment &assign) {
1129+
return common::visit(
1130+
common::visitors{
1131+
[](const evaluate::Assignment::BoundsSpec &) { return true; },
1132+
[](const evaluate::Assignment::BoundsRemapping &) { return true; },
1133+
[](const auto &) { return false; },
1134+
},
1135+
assign.u);
1136+
}
1137+
11281138
//===----------------------------------------------------------------------===//
11291139
// Op body generation helper structures and functions
11301140
//===----------------------------------------------------------------------===//
@@ -2869,6 +2879,10 @@ genAtomicOperation(lower::AbstractConverter &converter, mlir::Location loc,
28692879
fir::FirOpBuilder::InsertPoint preAt,
28702880
fir::FirOpBuilder::InsertPoint atomicAt,
28712881
fir::FirOpBuilder::InsertPoint postAt) {
2882+
if (isPointerAssignment(assign)) {
2883+
TODO(loc, "Code generation for pointer assignment is not implemented yet");
2884+
}
2885+
28722886
// This function and the functions called here do not preserve the
28732887
// builder's insertion point, or set it to anything specific.
28742888
switch (action) {

0 commit comments

Comments
 (0)