summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2014-11-04 21:57:32 +0000
committerTim Northover <tnorthover@apple.com>2014-11-04 21:57:32 +0000
commitf98b1c99603d7da0e7d3700e446fe864506294f8 (patch)
tree75a37eed9a137efe1ebad5e070ba7fb4ac7c1380 /lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp
parenta16974a5c06463d0191760388a790421b155164d (diff)
downloadbcm5719-llvm-f98b1c99603d7da0e7d3700e446fe864506294f8.tar.gz
bcm5719-llvm-f98b1c99603d7da0e7d3700e446fe864506294f8.zip
[mach-o] remove __compact_unwind atoms once __unwind_info has been generated
The job of the CompactUnwind pass is to turn __compact_unwind data (and __eh_frame) into the compressed final form in __unwind_info. After it's done, the original atoms are no longer relevant and should be deleted (they cause problems during actual execution, quite apart from the fact that they're not needed). llvm-svn: 221301
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp')
-rw-r--r--lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp b/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp
index f440cede201..9280ec43320 100644
--- a/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp
+++ b/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp
@@ -337,11 +337,15 @@ private:
<< " has " << entriesInPage << " entries\n");
} while (pageStart < unwindInfos.size());
- // FIXME: we should also erase all compact-unwind atoms; their job is done.
UnwindInfoAtom *unwind = new (_file.allocator())
UnwindInfoAtom(_archHandler, _file, _isBig, std::vector<uint32_t>(),
personalities, pages, numLSDAs);
mergedFile->addAtom(*unwind);
+
+ // Finally, remove all __compact_unwind atoms now that we've processed them.
+ mergedFile->removeDefinedAtomsIf([](const DefinedAtom *atom) {
+ return atom->contentType() == DefinedAtom::typeCompactUnwindInfo;
+ });
}
void collectCompactUnwindEntries(
OpenPOWER on IntegriCloud