[PATCH] D156429: [TableGen] Add new bang operator !format
Wang Pengcheng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 1 08:42:08 PDT 2023
wangpc marked 5 inline comments as done.
wangpc added inline comments.
================
Comment at: llvm/test/TableGen/format.td:23
+ string formatInterleave = !format("{0} {1} {0}", 0, 1);
+ string formatNoArg = !format("");
+ string formatLessArgs = !format("{0} {1}", 0);
----------------
michaelmaitland wrote:
> What happens for something like:
>
> `!format("{}")` or `format!("{1} {} {0} {}", 1, 2);`
`!format("{}")`->`"{}"`
`!format("{1} {} {0} {}", 1, 2)`->`2 {} 1 {}`
Currently, I haven't implemented the format specifier `{}`, the only supported one is `{i}`.
The implementation of this patch is very simple, I hope we can delegate formatting to `std::vformat` someday, but `std::vformat` needs C++ 20.
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