diff --git a/mlir/lib/IR/AffineMap.cpp b/mlir/lib/IR/AffineMap.cpp --- a/mlir/lib/IR/AffineMap.cpp +++ b/mlir/lib/IR/AffineMap.cpp @@ -744,13 +744,18 @@ replacements.reserve(numDimOrSym); auto createNewDimOrSym = (isDim) ? getAffineDimExpr : getAffineSymbolExpr; - auto replaceDims = [](AffineExpr e, ArrayRef replacements) { + + using replace_fn_ty = + std::function)>; + replace_fn_ty replaceDims = [](AffineExpr e, + ArrayRef replacements) { return e.replaceDims(replacements); }; - auto replaceSymbols = [](AffineExpr e, ArrayRef replacements) { + replace_fn_ty replaceSymbols = [](AffineExpr e, + ArrayRef replacements) { return e.replaceSymbols(replacements); }; - auto replaceNewDimOrSym = (isDim) ? replaceDims : replaceSymbols; + replace_fn_ty replaceNewDimOrSym = (isDim) ? replaceDims : replaceSymbols; MLIRContext *context = map.getContext(); int64_t newNumDimOrSym = 0;