[PATCH] D132739: [clang][Interp] Implement IntegralToBoolean casts

2022-09-07 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. tbaeder marked an inline comment as done. Closed by commit rG95e6a407d92b: [clang][Interp] Implement IntegralToBoolean casts (authored by tbaeder). Repository: rG LL

[PATCH] D132739: [clang][Interp] Implement IntegralToBoolean casts

2022-08-26 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked an inline comment as done. tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Boolean.h:90 + template static Boolean from(T Value) { +if constexpr (std::is_integral::value) + return Boolean(Value != 0); shafik wrote: > This

[PATCH] D132739: [clang][Interp] Implement IntegralToBoolean casts

2022-08-26 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added inline comments. Comment at: clang/lib/AST/Interp/Boolean.h:90 + template static Boolean from(T Value) { +if constexpr (std::is_integral::value) + return Boolean(Value != 0); This should work for `floating_point` as well. ===

[PATCH] D132739: [clang][Interp] Implement IntegralToBoolean casts

2022-08-26 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. LGTM! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132739/new/ https://reviews.llvm.org/D132739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[PATCH] D132739: [clang][Interp] Implement IntegralToBoolean casts

2022-08-26 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/lib/AST/Interp/Opcodes.td:433 +def ToCastTypeClass : TypeClass { + let Types = [Sint32, Bool]; } tbaeder wrote: > erichkeane wrote: > > tbaeder wrote: > > > erichkeane wrote: > > > > Not sure how this works...

[PATCH] D132739: [clang][Interp] Implement IntegralToBoolean casts

2022-08-26 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 455897. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132739/new/ https://reviews.llvm.org/D132739 Files: clang/lib/AST/Interp/Boolean.h clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/Opcodes.td clang/test/AST/Interp/literals.c

[PATCH] D132739: [clang][Interp] Implement IntegralToBoolean casts

2022-08-26 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Opcodes.td:433 +def ToCastTypeClass : TypeClass { + let Types = [Sint32, Bool]; } erichkeane wrote: > tbaeder wrote: > > erichkeane wrote: > > > Not sure how this works... but is this ONLY int-32 t

[PATCH] D132739: [clang][Interp] Implement IntegralToBoolean casts

2022-08-26 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/lib/AST/Interp/Opcodes.td:433 +def ToCastTypeClass : TypeClass { + let Types = [Sint32, Bool]; } tbaeder wrote: > erichkeane wrote: > > Not sure how this works... but is this ONLY int-32 to bool and vice versa

[PATCH] D132739: [clang][Interp] Implement IntegralToBoolean casts

2022-08-26 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Opcodes.td:433 +def ToCastTypeClass : TypeClass { + let Types = [Sint32, Bool]; } erichkeane wrote: > Not sure how this works... but is this ONLY int-32 to bool and vice versa? > The implementati

[PATCH] D132739: [clang][Interp] Implement IntegralToBoolean casts

2022-08-26 Thread Erich Keane via Phabricator via cfe-commits
erichkeane accepted this revision. erichkeane added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/AST/Interp/Opcodes.td:433 +def ToCastTypeClass : TypeClass { + let Types = [Sint32, Bool]; } Not sure how this works... b

[PATCH] D132739: [clang][Interp] Implement IntegralToBoolean casts

2022-08-26 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, shafik, tahonermann. Herald added a subscriber: inglorion. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Redo how we d