[PATCH] D92509: ADT: Remove redundant `alignas` from IntervalMap, NFC
Reid Kleckner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 2 14:13:11 PST 2020
rnk accepted this revision.
rnk added a comment.
If you look at the copy of AlignedCharArrayUnion at the time, you can see that it did not use alignas:
https://github.com/llvm/llvm-project/blob/379daa29744cd96b0a87ed0d4a010fa4bc47ce73/llvm/include/llvm/Support/AlignOf.h
At the time, x86 MSVC 2015 would reject attempts to pass overaligned objects by value. Instead, it would just misalign them (4 byte alignment only). People were passing AlignedCharArray objects by value, so we couldn't use alignas without breaking the build. We just had to live with misalignment bugs. Somewhere back in MSVC 2017 they added support for passing overaligned arguments by value (nevermind that it had bugs: https://developercommunity2.visualstudio.com/t/msvc-copies-overaligned-non-trivially-copyable-par/1179643), so we started using alignas.
Now that alignas is safe to use anywhere and it is used by AlignedCharArray, we can remove this redundant alignment requirement.
lgtm
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92509/new/
https://reviews.llvm.org/D92509
More information about the llvm-commits
mailing list