[PATCH] D50935: Add data structure to form equivalence classes of mangled names.

Richard Smith - zygoloid via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 24 15:16:00 PDT 2018


rsmith marked an inline comment as done.
rsmith added inline comments.


================
Comment at: lib/Support/ItaniumManglingCanonicalizer.cpp:92
+class FoldingNodeAllocator {
+  class alignas(alignof(Node *)) NodeHeader : public llvm::FoldingSetNode {
+  public:
----------------
erik.pilkington wrote:
> Shouldn't this technically be alignof(Node)?
`alignof(Node)` isn't necessarily going to be enough in the medium term; we want at least enough alignment for all the derived classes of `Node`. `alignof(Node)` is enough for now, but only because `Node` has a vptr; if we remove the vptr, which we probably should, then we might not have sufficient alignment. Alignment for a `Node*` member is the most that any of the derived classes needs, so that's what I asked for here.

`getOrCreateNode` has a `static_assert` to ensure that we catch any problems introduced by a `Node` subclass having a higher alignment requirement than this.


Repository:
  rL LLVM

https://reviews.llvm.org/D50935





More information about the llvm-commits mailing list