[PATCH] D149645: [clang][Interp] Optionally cast comparison result to non-bool

2023-05-31 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG81522a012acc: [clang][Interp] Optionally cast comparison result to non-bool (authored by tbaeder). Changed prior to commit:

[PATCH] D149645: [clang][Interp] Optionally cast comparison result to non-bool

2023-05-02 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. In D149645#4312193 , @erichkeane wrote: > In D149645#4312190 , @tbaeder wrote: > >> In D149645#4312162 , @erichkeane >> wrote: >> >>> For C,

[PATCH] D149645: [clang][Interp] Optionally cast comparison result to non-bool

2023-05-02 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 518707. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149645/new/ https://reviews.llvm.org/D149645 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/test/AST/Interp/c.c Index: clang/test/AST/Interp/c.c

[PATCH] D149645: [clang][Interp] Optionally cast comparison result to non-bool

2023-05-02 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. In D149645#4312190 , @tbaeder wrote: > In D149645#4312162 , @erichkeane > wrote: > >> For C, should we instead be teaching our boolean operations to understand it >> might be int? I

[PATCH] D149645: [clang][Interp] Optionally cast comparison result to non-bool

2023-05-02 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. In D149645#4312162 , @erichkeane wrote: > For C, should we instead be teaching our boolean operations to understand it > might be int? I fear this will end up causing conversion problems later, > such as with: > > `int F = 1

[PATCH] D149645: [clang][Interp] Optionally cast comparison result to non-bool

2023-05-02 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. For C, should we instead be teaching our boolean operations to understand it might be int? I fear this will end up causing conversion problems later, such as with: `int F = 1 > 2;`. We won't end up having a conversion operation there, since the RHS is already

[PATCH] D149645: [clang][Interp] Optionally cast comparison result to non-bool

2023-05-02 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, tahonermann, shafik. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Our comparison opcodes always produce a Boolean