[PATCH] D133941: [clang][Interp] Record item types in InterpStack

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 16 06:21:22 PDT 2022


erichkeane accepted this revision.
erichkeane added a comment.
This revision is now accepted and ready to land.

is_same_v would be an improvement, but otherwise I think this is fine.



================
Comment at: clang/lib/AST/Interp/InterpStack.h:140
+    else if constexpr (std::is_same<T, int8_t>::value ||
+                       std::is_same<T, Integral<8, true>>::value)
+      return PT_Sint8;
----------------
Side note: Having `Integral`'s 2nd template parameter be a bool here is a bad design decision IMO.  It should probably be an enum, so that we can just do:

`Integral<8, Signed>` or `Integral<8, Unsigned>` kinda thing.


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

https://reviews.llvm.org/D133941



More information about the cfe-commits mailing list