diff options
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp')
| -rw-r--r-- | lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp b/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp index 3b9c6fb9973..f23bfc86a6e 100644 --- a/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp +++ b/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp @@ -598,7 +598,7 @@ Writer &MachOLinkingContext::writer() const { } MachODylibFile* MachOLinkingContext::loadIndirectDylib(StringRef path) { - std::unique_ptr<MachOFileNode> node(new MachOFileNode(path, false, *this)); + std::unique_ptr<MachOFileNode> node(new MachOFileNode(path, *this)); std::error_code ec = node->parse(*this, llvm::errs()); if (ec) return nullptr; @@ -668,15 +668,26 @@ bool MachOLinkingContext::createImplicitFiles( } -void MachOLinkingContext::registerDylib(MachODylibFile *dylib) const { +void MachOLinkingContext::registerDylib(MachODylibFile *dylib, + bool upward) const { _allDylibs.insert(dylib); _pathToDylibMap[dylib->installName()] = dylib; // If path is different than install name, register path too. if (!dylib->path().equals(dylib->installName())) _pathToDylibMap[dylib->path()] = dylib; + if (upward) + _upwardDylibs.insert(dylib); } +bool MachOLinkingContext::isUpwardDylib(StringRef installName) const { + for (MachODylibFile *dylib : _upwardDylibs) { + if (dylib->installName().equals(installName)) + return true; + } + return false; +} + ArchHandler &MachOLinkingContext::archHandler() const { if (!_archHandler) _archHandler = ArchHandler::create(_arch); |

