Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADT: Add non-const overload of PackedVector::raw_bits() #101742

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

nhaehnle
Copy link
Collaborator

@nhaehnle nhaehnle commented Aug 2, 2024

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

This is convenient when operating on vectors in a bulk, bit-manipulating
fashion. I plan to use this in a future change.
@nhaehnle nhaehnle requested review from Sisyph and rampitec August 2, 2024 19:44
@llvmbot
Copy link
Member

llvmbot commented Aug 2, 2024

@llvm/pr-subscribers-llvm-adt

Author: Nicolai Hähnle (nhaehnle)

Changes

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 --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.

Copy link
Collaborator

@rampitec rampitec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nhaehnle nhaehnle merged commit 5edb493 into llvm:main Aug 2, 2024
7 of 8 checks passed
@nhaehnle nhaehnle deleted the pub-packedvector branch August 2, 2024 20:29
@dwblaikie
Copy link
Collaborator

Would be nice to include some (albeit, pretty trivial) test coverage.

banach-space pushed a commit to banach-space/llvm-project that referenced this pull request Aug 7, 2024
This is convenient when operating on vectors in a bulk, bit-manipulating
fashion. I plan to use this in a future change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants