[llvm] [ADT] Bitset: add shift operators, word accessors, and etc (PR #193400)

Jakub Kuderski via llvm-commits llvm-commits at lists.llvm.org
Sun May 3 18:10:09 PDT 2026


================
@@ -194,6 +194,95 @@ template <unsigned NumBits> class Bitset {
     }
     return false;
   }
+
+  constexpr Bitset &operator<<=(unsigned N) {
+    if (N == 0)
+      return *this;
+    if (N >= NumBits) {
----------------
kuhar wrote:

nit: drop braces [LLVM coding standard on single-statement bodies](https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements). The surrounding code in this file already follows that rule (e.g. the `if (N == 0) return *this;` two lines above), so this is a consistency fix as well.


https://github.com/llvm/llvm-project/pull/193400


More information about the llvm-commits mailing list