[PATCH] D156429: [TableGen] Add new bang operator !format
Michael Maitland via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 27 07:22:23 PDT 2023
michaelmaitland added inline comments.
================
Comment at: llvm/test/TableGen/format.td:24
+ string formatNoArg = !format("");
+ string formatLessArgs = !format("{0} {1}", 0);
+ string formatMoreArgs = !format("{0} {1}", 0, 1, 2);
----------------
Emit a warning? Probably an unintended usage of `!format`.
================
Comment at: llvm/test/TableGen/format.td:25
+ string formatLessArgs = !format("{0} {1}", 0);
+ string formatMoreArgs = !format("{0} {1}", 0, 1, 2);
+ string formatOperatorArg = !format("{0}", !if(bitValue, 1, 0));
----------------
Emit a warning? Probably an unintended usage of `!format`.
================
Comment at: llvm/test/TableGen/format.td:67
+defvar error = !format(1)
+#endif
----------------
Could be nice to add:
* Format string but not enough arguments
* Format string but too many arguments
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156429/new/
https://reviews.llvm.org/D156429
More information about the llvm-commits
mailing list