[mlir] Fix a warning

This patch fixes:

  mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp:2905:17: error: unused
  variable 'var' [-Werror,-Wunused-variable]

  mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp:2908:42: error: unused
  variable 'dataClauseOptional' [-Werror,-Wunused-variable]
This commit is contained in:
Kazu Hirata
2025-04-28 22:18:55 -07:00
parent 2f1ef1d183
commit bbbb178a35

View File

@@ -2905,11 +2905,13 @@ checkDeclareOperands(Op &op, const mlir::ValueRange &operands,
mlir::Value var{getVar(operand.getDefiningOp())};
assert(var && "declare operands can only be data entry operations which "
"must have var");
(void)var;
std::optional<mlir::acc::DataClause> dataClauseOptional{
getDataClause(operand.getDefiningOp())};
assert(dataClauseOptional.has_value() &&
"declare operands can only be data entry operations which must have "
"dataClause");
(void)dataClauseOptional;
}
return success();