Skip to content

Commit 0e497f8

Browse files
committed
address review comments
1 parent 126ea5c commit 0e497f8

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def PDLInterp_ApplyConstraintOp : PDLInterp_PredicateOp<"apply_constraint"> {
100100
pdl_interp.apply_constraint "myConstraint"(%input, %attr, %op : !pdl.value, !pdl.attribute, !pdl.operation) -> ^matchDest, ^failureDest
101101
```
102102
}];
103+
103104
let arguments = (ins StrAttr:$name, Variadic<PDL_AnyType>:$args, DefaultValuedAttr<BoolAttr,"false">:$isNegated);
104105
let results = (outs Variadic<PDL_AnyType>:$results);
105106
let assemblyFormat = [{

mlir/lib/Tools/PDLL/Parser/Parser.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,11 +1849,6 @@ FailureOr<ast::Expr *> Parser::parseExpr() {
18491849
case Token::dot:
18501850
lhsExpr = parseMemberAccessExpr(*lhsExpr);
18511851
break;
1852-
// case Token::exclam:
1853-
// // TODO: Fx: This parses the "!" as suffix instead of prefix.
1854-
// consumeToken(Token::exclam);
1855-
// lhsExpr = parseCallExpr(*lhsExpr, /*isNegated = */ true);
1856-
// break;
18571852
case Token::l_paren:
18581853
lhsExpr = parseCallExpr(*lhsExpr);
18591854
break;
@@ -2825,6 +2820,8 @@ Parser::createCallExpr(SMRange loc, ast::Expr *parentExpr,
28252820
if (isa<ast::UserConstraintDecl>(callableDecl))
28262821
return emitError(
28272822
loc, "unable to invoke `Constraint` within a rewrite section");
2823+
if (isNegated)
2824+
return emitError(loc, "negation of Rewrites is not supported");
28282825
} else if (isa<ast::UserRewriteDecl>(callableDecl)) {
28292826
return emitError(loc, "unable to invoke `Rewrite` within a match section");
28302827
}

0 commit comments

Comments
 (0)