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

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 26 07:02:55 PDT 2022


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... but is this ONLY int-32 to bool and vice versa?  The implementation of any of the other integrals should be trivial.
> > > Yes exactly, the primitive types are:
> > > ```
> > > def Bool : Type;
> > > def Sint8 : Type;
> > > def Uint8 : Type;
> > > def Sint16 : Type;
> > > def Uint16 : Type;
> > > def Sint32 : Type;
> > > def Uint32 : Type;
> > > def Sint64 : Type;
> > > def Uint64 : Type;
> > > def Ptr : Type;
> > > ```
> > So why not fill them in here as well? 
> I think I can add `Uint32` as well, but for the others I can't write tests yet since I don't have their literals implemented yet.
Got it, thanks!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132739/new/

https://reviews.llvm.org/D132739



More information about the cfe-commits mailing list