diff options
Diffstat (limited to 'mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp')
-rw-r--r-- | mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp index 6e5df70..08e83ca 100644 --- a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp +++ b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp @@ -1087,9 +1087,10 @@ LogicalResult AtomicCaptureOp::verifyRegions() { return verifyRegionsCommon(); } //===----------------------------------------------------------------------===// template <typename Op> -static LogicalResult checkDeclareOperands(Op &op, - const mlir::ValueRange &operands) { - if (operands.empty()) +static LogicalResult +checkDeclareOperands(Op &op, const mlir::ValueRange &operands, + bool requireAtLeastOneOperand = true) { + if (operands.empty() && requireAtLeastOneOperand) return emitError( op->getLoc(), "at least one operand must appear on the declare operation"); @@ -1151,6 +1152,9 @@ LogicalResult acc::DeclareEnterOp::verify() { //===----------------------------------------------------------------------===// LogicalResult acc::DeclareExitOp::verify() { + if (getToken()) + return checkDeclareOperands(*this, this->getDataClauseOperands(), + /*requireAtLeastOneOperand=*/false); return checkDeclareOperands(*this, this->getDataClauseOperands()); } |