[clang] [clang] Implement constexpr heap allocation alignments (PR #174549)

via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 16 03:45:07 PDT 2026


================
@@ -63,30 +64,48 @@ class TypeInfoLValue {
 
 /// Symbolic representation of a dynamic allocation.
 class DynamicAllocLValue {
-  unsigned Index;
+  // lower NumAlignmentBits: alignment exponent
+  // remaining bits: allocation index incremented by one
+  // value of zero indicates distinct empty state
+  unsigned AlignAndIndex;
----------------
keinflue wrote:

This bothered me as well as I noted in the PR description, but I recall not finding a good alternative solution without significantly wider changes. I'd be happy to accept any alternative suggestion for storing the alignment in such a way that it lives long enough.

I haven't looked at this PR in a while and likely won't be able to work on it for at least the next week. If someone else wants to pick it up, feel free to do so.

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


More information about the cfe-commits mailing list