mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Previously, this storage required that alignof(void *) >= alignof(Decl). This is true on 64-bit platforms, where these are both 8, but on 32-bit platforms alignof(void *) is only 4. This now allocates enough bytes to match the alignment of the Decl in question. This does mean that a void * must fit in that alignment, but this is true on 32- and 64-bit platforms, and a static_assert ensures that this is true at compile time. As part of this change, the logic for allocating memory for a Decl has been refactored into a separate function, so that the logic for allocating space for a ClangNode can be centralized. Swift SVN r23990
175 KiB
175 KiB