[PATCH] D135012: [clang][Interp] Implement bitwise and operations
Shafik Yaghmour via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 3 12:48:32 PDT 2022
shafik added inline comments.
================
Comment at: clang/lib/AST/Interp/Integral.h:215
+ static bool band(Integral A, Integral B, unsigned OpBits, Integral *R) {
+ *R = Integral(A.V & B.V);
----------------
Maybe `bitAnd`?
================
Comment at: clang/test/AST/Interp/literals.cpp:288
+
+ static_assert((1337 & -1) == 1337, "");
+};
----------------
Also `0 &` something else should be `0`.
I wonder if there is any value in using binary literals.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135012/new/
https://reviews.llvm.org/D135012
More information about the cfe-commits
mailing list