[PATCH] D125489: [Metadata][NFC] Refactor allocation, initialization, and deletion of MDNodes

Wolfgang Pieb via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 12 11:33:02 PDT 2022


wolfgangp created this revision.
wolfgangp added a reviewer: dexonsmith.
Herald added a subscriber: hiraditya.
Herald added a project: All.
wolfgangp requested review of this revision.
Herald added a project: LLVM.

This patch is refactoring the allocation, initialization and deletion of MDNodes. It is intended as a preparatory patch for the upcoming
 addition of dynamic resizability of MDNodes. It is fundamentally NFC, but removes the necessity for suppressing the memory sanitizer for
 MDNode's operator delete.

Refer to the discussion in D124548 <https://reviews.llvm.org/D124548> for more context.

The intended usage of SmallVector to handle the operands of "large" and  resizable MDNodes seems to require that we define move constructors, copy constructors and the respective assignment operators for MDOperand. I've saved these for a later patch, as they're not required for this one.

The refactoring of operator new() requiring an extra parameter (Storage) is preparatory in the sense that operator new will have to decide whether to allocate a node for resizability based on storage type.


https://reviews.llvm.org/D125489

Files:
  llvm/include/llvm/IR/Metadata.h
  llvm/lib/IR/DebugInfoMetadata.cpp
  llvm/lib/IR/Metadata.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125489.429021.patch
Type: text/x-patch
Size: 13148 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220512/2310b5e1/attachment.bin>


More information about the llvm-commits mailing list