Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions llvm/include/llvm/TextAPI/SymbolSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class SymbolSet {

public:
SymbolSet() = default;
~SymbolSet();
LLVM_ABI Symbol *addGlobal(EncodeKind Kind, StringRef Name, SymbolFlags Flags,
const Target &Targ);
size_t size() const { return Symbols.size(); }
Expand Down
5 changes: 5 additions & 0 deletions llvm/lib/TextAPI/SymbolSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
using namespace llvm;
using namespace llvm::MachO;

SymbolSet::~SymbolSet() {
for (auto &[Key, Sym] : Symbols)
Sym->~Symbol();
}

Symbol *SymbolSet::addGlobalImpl(EncodeKind Kind, StringRef Name,
SymbolFlags Flags) {
Name = copyString(Name);
Expand Down
20 changes: 20 additions & 0 deletions llvm/test/tools/llvm-readtapi/many-targets.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
; RUN: rm -rf %t
; RUN: split-file %s %t
;
; RUN: llvm-readtapi %t/many-targets.tbd
;
; Check that tbds containing symbols with many targets parse correctly (and in
; particular parse without leaks).

;--- many-targets.tbd
--- !tapi-tbd
tbd-version: 4
targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst, arm64-ios, arm64e-ios ]
install-name: '/usr/lib/foo.dylib'
current-version: 1
exports:
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst, arm64-ios, arm64e-ios ]
symbols: [ 'foo' ]
...