Skip to content

Commit d3e796c

Browse files
authored
[MLIR][OpenMP] Update not-yet-implemented errors, NFC (#114966)
This patch improves not-yet-implemented error diagnostics to more closely follow the format used by Flang lowering for the same kind of errors. This helps keep some level of uniformity from a user perspective.
1 parent cfa5ecd commit d3e796c

File tree

2 files changed

+50
-49
lines changed

2 files changed

+50
-49
lines changed

mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ static omp::PrivateClauseOp findPrivatizer(Operation *from,
145145
/// given operation.
146146
static LogicalResult checkImplementationStatus(Operation &op) {
147147
auto todo = [&op](StringRef clauseName) {
148-
return op.emitError(clauseName + " clause not yet supported");
148+
return op.emitError() << "not yet implemented: Unhandled clause "
149+
<< clauseName << " in " << op.getName()
150+
<< " operation";
149151
};
150152

151153
auto checkAligned = [&todo](auto op, LogicalResult &result) {
@@ -306,8 +308,8 @@ static LogicalResult checkImplementationStatus(Operation &op) {
306308
result = todo("firstprivate");
307309

308310
if (!privatizer.getDeallocRegion().empty())
309-
result =
310-
op.emitError("privatization of structures not yet supported");
311+
result = op.emitError("not yet implemented: privatization of "
312+
"structures in omp.target operation");
311313
}
312314
}
313315
checkThreadLimit(op, result);
@@ -4095,8 +4097,7 @@ convertHostOrTargetOperation(Operation *op, llvm::IRBuilderBase &builder,
40954097
return success();
40964098
})
40974099
.Default([&](Operation *inst) {
4098-
return inst->emitError("unsupported OpenMP operation: ")
4099-
<< inst->getName();
4100+
return inst->emitError() << "not yet implemented: " << inst->getName();
41004101
});
41014102
}
41024103

0 commit comments

Comments
 (0)