[PATCH] D90635: [TableGen] Add true and false literals to represent booleans
Jessica Clarke via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 5 12:59:29 PST 2020
jrtc27 added a comment.
In D90635#2377143 <https://reviews.llvm.org/D90635#2377143>, @Paul-C-Anagnostopoulos wrote:
> Sorry, I'm not sure what you mean by "these." If you mean 'true' and 'false', they are simply named literals for 1 and 0. So they can be used in any context where an integer is allowed.
>
> A field type of 'bit' is used for boolean fields. It is also used for single-bit fields where the individual bits feature of bits<n> is not required.
>
> I contemplated inventing a 'boolean' type, but quickly gave up on that idea.
Yes, I meant the literals. It's less than ideal IMO that `bits<3> = true` is valid; I personally think that should be a type error.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D90635/new/
https://reviews.llvm.org/D90635
More information about the llvm-commits
mailing list