[lld] r226153 - Simplify.
Rui Ueyama
ruiu at google.com
Thu Jan 15 00:51:23 PST 2015
Author: ruiu
Date: Thu Jan 15 02:51:23 2015
New Revision: 226153
URL: http://llvm.org/viewvc/llvm-project?rev=226153&view=rev
Log:
Simplify.
Modified:
lld/trunk/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
Modified: lld/trunk/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/MachOLinkingContext.cpp?rev=226153&r1=226152&r2=226153&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/MachOLinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/MachOLinkingContext.cpp Thu Jan 15 02:51:23 2015
@@ -928,14 +928,12 @@ bool MachOLinkingContext::customAtomOrde
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
More information about the llvm-commits
mailing list