summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-01-15 08:51:23 +0000
committerRui Ueyama <ruiu@google.com>2015-01-15 08:51:23 +0000
commitae1daae46132170039ee2631c29cd36e8df4d0e8 (patch)
treea0ae0835363457a0aaf223514dba150d9c214fac /lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
parent3a1e1a542447ad2a2dac4a892751d239e5c013d6 (diff)
downloadbcm5719-llvm-ae1daae46132170039ee2631c29cd36e8df4d0e8.tar.gz
bcm5719-llvm-ae1daae46132170039ee2631c29cd36e8df4d0e8.zip
Simplify.
llvm-svn: 226153
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp')
-rw-r--r--lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp b/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
index cd36c3545d5..24e17d0a5cf 100644
--- a/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
+++ b/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
@@ -928,14 +928,12 @@ bool MachOLinkingContext::customAtomOrderer(const DefinedAtom *left,
return true;
}
-static File *getFirstFile(const std::unique_ptr<Node> &elem) {
- FileNode *e = dyn_cast<FileNode>(const_cast<Node *>(elem.get()));
- return e ? e->getFile() : nullptr;
-}
-
static bool isLibrary(const std::unique_ptr<Node> &elem) {
- File *f = getFirstFile(elem);
- return f && (isa<SharedLibraryFile>(f) || isa<ArchiveLibraryFile>(f));
+ if (FileNode *node = dyn_cast<FileNode>(const_cast<Node *>(elem.get()))) {
+ File *file = node->getFile();
+ return isa<SharedLibraryFile>(file) || isa<ArchiveLibraryFile>(file);
+ }
+ return false;
}
// The darwin linker processes input files in two phases. The first phase
OpenPOWER on IntegriCloud