diff --git a/mlir/include/mlir/IR/OpImplementation.h b/mlir/include/mlir/IR/OpImplementation.h --- a/mlir/include/mlir/IR/OpImplementation.h +++ b/mlir/include/mlir/IR/OpImplementation.h @@ -1035,7 +1035,7 @@ /// Parse an affine expr instance into 'expr' using the already computed /// mapping from symbols to affine expressions in 'symbolSet'. virtual ParseResult - parseAffineExpr(SmallVectorImpl> &symbolSet, + parseAffineExpr(ArrayRef> symbolSet, AffineExpr &expr) = 0; /// Parse an integer set instance into 'set'. diff --git a/mlir/lib/AsmParser/AffineParser.cpp b/mlir/lib/AsmParser/AffineParser.cpp --- a/mlir/lib/AsmParser/AffineParser.cpp +++ b/mlir/lib/AsmParser/AffineParser.cpp @@ -53,9 +53,9 @@ ParseResult parseAffineMapRange(unsigned numDims, unsigned numSymbols, AffineMap &result); ParseResult parseAffineMapOrIntegerSetInline(AffineMap &map, IntegerSet &set); - ParseResult parseAffineExprInline( - SmallVectorImpl> &symbolSet, - AffineExpr &expr); + ParseResult + parseAffineExprInline(ArrayRef> symbolSet, + AffineExpr &expr); ParseResult parseIntegerSetConstraints(unsigned numDims, unsigned numSymbols, IntegerSet &result); ParseResult parseAffineMapOfSSAIds(AffineMap &map, @@ -538,9 +538,8 @@ /// Parse an affine expresion definition inline, with given symbols. ParseResult AffineParser::parseAffineExprInline( - SmallVectorImpl> &symbolSet, - AffineExpr &expr) { - dimsAndSymbols.assign(symbolSet); + ArrayRef> symbolSet, AffineExpr &expr) { + dimsAndSymbols.assign(symbolSet.begin(), symbolSet.end()); expr = parseAffineExpr(); return success(expr != nullptr); } @@ -716,8 +715,7 @@ return success(); } ParseResult Parser::parseAffineExprReference( - SmallVectorImpl> &symbolSet, - AffineExpr &expr) { + ArrayRef> symbolSet, AffineExpr &expr) { return AffineParser(state).parseAffineExprInline(symbolSet, expr); } ParseResult Parser::parseIntegerSetReference(IntegerSet &set) { diff --git a/mlir/lib/AsmParser/AsmParserImpl.h b/mlir/lib/AsmParser/AsmParserImpl.h --- a/mlir/lib/AsmParser/AsmParserImpl.h +++ b/mlir/lib/AsmParser/AsmParserImpl.h @@ -459,7 +459,7 @@ /// Parse an affine expr instance into 'expr' using the already computed /// mapping from symbols to affine expressions in 'symbolSet'. ParseResult - parseAffineExpr(SmallVectorImpl> &symbolSet, + parseAffineExpr(ArrayRef> symbolSet, AffineExpr &expr) override { return parser.parseAffineExprReference(symbolSet, expr); } diff --git a/mlir/lib/AsmParser/Parser.h b/mlir/lib/AsmParser/Parser.h --- a/mlir/lib/AsmParser/Parser.h +++ b/mlir/lib/AsmParser/Parser.h @@ -300,9 +300,9 @@ ParseResult parseAffineMapOrIntegerSetReference(AffineMap &map, IntegerSet &set); ParseResult parseAffineMapReference(AffineMap &map); - ParseResult parseAffineExprReference( - SmallVectorImpl> &symbolSet, - AffineExpr &expr); + ParseResult + parseAffineExprReference(ArrayRef> symbolSet, + AffineExpr &expr); ParseResult parseIntegerSetReference(IntegerSet &set); /// Parse an AffineMap where the dim and symbol identifiers are SSA ids.