[PATCH] D93911: [TableGen] Add the assert statement, step 1
Chris Lattner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 5 10:37:02 PST 2021
lattner added a comment.
Looks like a great feature to me! I'd recommend requiring the message, I'd also consider requiring parens around the condition and message. This makes it more C like and makes it look less like a type definition:
def Rec14 : Cube<3> {
int double_result = !mul(result, 2);
assert(!eq(double_result, 53), "double_result should be 54");
}
================
Comment at: llvm/docs/TableGen/ProgRef.rst:1258
+.. productionlist::
+ Assert: "assert" `condition` ["," `message`] ";"
+
----------------
Given that we don't have backwards compatibility issues, I'd just require the message.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D93911/new/
https://reviews.llvm.org/D93911
More information about the llvm-commits
mailing list