[PATCH] D114356: [Support] Add isShiftedUIntN to MathExtras.h

Luís Marques via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 5 06:59:10 PDT 2022


luismarques accepted this revision.
luismarques added a comment.
This revision is now accepted and ready to land.
Herald added a project: All.

LGTM.



================
Comment at: llvm/unittests/Support/MathExtrasTest.cpp:501-504
+  EXPECT_FALSE((isShiftedUIntN(1, 0, 0x8000000000000000)));
+  EXPECT_TRUE((isShiftedUIntN(1, 63, 0x8000000000000000)));
+  EXPECT_TRUE((isShiftedUIntN(2, 62, 0xC000000000000000)));
+  EXPECT_FALSE((isShiftedUIntN(2, 62, 0xE000000000000000)));
----------------
Nit: not a blocker but adding some `'` digit group separators would help with the readability of the large constant literals. Most of this file probably predates that C++ spec feature but we could add them as we go.


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

https://reviews.llvm.org/D114356



More information about the llvm-commits mailing list