[lld] ee7a286 - Revert "[lld-macho] Avoid using bump-alloc in TrieBuider"

Sterling Augustine via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 14 15:23:29 PDT 2022


Author: Sterling Augustine
Date: 2022-03-14T15:23:04-07:00
New Revision: ee7a286cd3e4364d2f7d5b6ba4b8a6fc0d524854

URL: https://github.com/llvm/llvm-project/commit/ee7a286cd3e4364d2f7d5b6ba4b8a6fc0d524854
DIFF: https://github.com/llvm/llvm-project/commit/ee7a286cd3e4364d2f7d5b6ba4b8a6fc0d524854.diff

LOG: Revert "[lld-macho] Avoid using bump-alloc in TrieBuider"

This reverts commit e049a87f04cff8e81b4177097a6b2fdf37c7b148.

That commit breaks the build with errors of the form:

/usr/local/google/home/saugustine/llvm/llvm-project/lld/MachO/ExportTrie.cpp:148:11: error: definition of implicitly declared destructor
TrieNode::~TrieNode() {

Added: 
    

Modified: 
    lld/MachO/ExportTrie.cpp
    lld/MachO/ExportTrie.h

Removed: 
    


################################################################################
diff  --git a/lld/MachO/ExportTrie.cpp b/lld/MachO/ExportTrie.cpp
index 1c11f4a32e0a8..372690a20df67 100644
--- a/lld/MachO/ExportTrie.cpp
+++ b/lld/MachO/ExportTrie.cpp
@@ -145,13 +145,8 @@ void TrieNode::writeTo(uint8_t *buf) const {
   }
 }
 
-TrieNode::~TrieNode() {
-  for (TrieNode *node : nodes)
-    delete node;
-}
-
 TrieNode *TrieBuilder::makeNode() {
-  auto *node = new TrieNode();
+  auto *node = make<TrieNode>();
   nodes.emplace_back(node);
   return node;
 }

diff  --git a/lld/MachO/ExportTrie.h b/lld/MachO/ExportTrie.h
index 0675d8257a2a6..a43f4f2cce98b 100644
--- a/lld/MachO/ExportTrie.h
+++ b/lld/MachO/ExportTrie.h
@@ -22,7 +22,6 @@ class Symbol;
 
 class TrieBuilder {
 public:
-  ~TrieBuilder();
   void setImageBase(uint64_t addr) { imageBase = addr; }
   void addSymbol(const Symbol &sym) { exported.push_back(&sym); }
   // Returns the size in bytes of the serialized trie.


        


More information about the llvm-commits mailing list