[llvm] ADT: Add non-const overload of PackedVector::raw_bits() (PR #101742)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 2 12:45:12 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-adt

Author: Nicolai Hähnle (nhaehnle)

<details>
<summary>Changes</summary>

This is convenient when operating on vectors in a bulk, bit-manipulating fashion. I plan to use this in a future change.

---
Full diff: https://github.com/llvm/llvm-project/pull/101742.diff


1 Files Affected:

- (modified) llvm/include/llvm/ADT/PackedVector.h (+1) 


``````````diff
diff --git a/llvm/include/llvm/ADT/PackedVector.h b/llvm/include/llvm/ADT/PackedVector.h
index 4a6986669c936..b6bb6a4738067 100644
--- a/llvm/include/llvm/ADT/PackedVector.h
+++ b/llvm/include/llvm/ADT/PackedVector.h
@@ -143,6 +143,7 @@ class PackedVector : public PackedVectorBase<T, BitNum, BitVectorTy,
   }
 
   const BitVectorTy &raw_bits() const { return Bits; }
+  BitVectorTy &raw_bits() { return Bits; }
 };
 
 // Leave BitNum=0 undefined.

``````````

</details>


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


More information about the llvm-commits mailing list