Emit an error for missing '[' when parsing an AffineMapOfSSAIds.

Fixes tensorflow/mlir#51

PiperOrigin-RevId: 259415034
This commit is contained in:
River Riddle 2019-07-22 15:06:15 -07:00 committed by A. Unique TensorFlower
parent 8b8caa888d
commit 40493a07a3
2 changed files with 10 additions and 1 deletions

View File

@ -2329,7 +2329,7 @@ ParseResult AffineParser::parseAffineMapOrIntegerSetInline(AffineMap &map,
/// Parse an AffineMap where the dim and symbol identifiers are SSA ids.
ParseResult AffineParser::parseAffineMapOfSSAIds(AffineMap &map) {
if (!consumeIf(Token::l_square))
if (parseToken(Token::l_square, "expected '['"))
return failure();
SmallVector<AffineExpr, 4> exprs;

View File

@ -142,3 +142,12 @@ func @affine_if_invalid_dimop_dim(%arg0: index, %arg1: index, %arg2: index, %arg
}
return
}
// -----
func @affine_store_missing_l_square(%C: memref<4096x4096xf32>) {
%9 = constant 0.0 : f32
// expected-error@+1 {{expected '['}}
affine.store %9, %C : memref<4096x4096xf32>
return
}