From: Alexander Shaposhnikov Date: Sat, 29 Jul 2017 00:30:45 +0000 (+0000) Subject: [llvm] Update MachOObjectFile::exports interface X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e574034f28edec57868123d040de6a962c9c71e8;p=platform%2Fupstream%2Fllvm.git [llvm] Update MachOObjectFile::exports interface This diff removes the second argument of the method MachOObjectFile::exports. In all in-tree uses this argument is equal to "this" and without this argument the interface seems to be cleaner. Test plan: make check-all llvm-svn: 309462 --- diff --git a/llvm/include/llvm/Object/MachO.h b/llvm/include/llvm/Object/MachO.h index f2b273c..a4ecc51 100644 --- a/llvm/include/llvm/Object/MachO.h +++ b/llvm/include/llvm/Object/MachO.h @@ -365,8 +365,7 @@ public: iterator_range load_commands() const; /// For use iterating over all exported symbols. - iterator_range exports(Error &Err, - const MachOObjectFile *O) const; + iterator_range exports(Error &Err) const; /// For use examining a trie not in a MachOObjectFile. static iterator_range exports(Error &Err, diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index 579faf6..af8ee40 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -2908,9 +2908,8 @@ MachOObjectFile::exports(Error &E, ArrayRef Trie, return make_range(export_iterator(Start), export_iterator(Finish)); } -iterator_range MachOObjectFile::exports(Error &Err, - const MachOObjectFile *O) const { - return exports(Err, getDyldInfoExportsTrie(), O); +iterator_range MachOObjectFile::exports(Error &Err) const { + return exports(Err, getDyldInfoExportsTrie(), this); } MachORebaseEntry::MachORebaseEntry(Error *E, const MachOObjectFile *O, diff --git a/llvm/tools/llvm-nm/llvm-nm.cpp b/llvm/tools/llvm-nm/llvm-nm.cpp index e6378a7..126a9ae 100644 --- a/llvm/tools/llvm-nm/llvm-nm.cpp +++ b/llvm/tools/llvm-nm/llvm-nm.cpp @@ -1227,8 +1227,7 @@ dumpSymbolNamesFromObject(SymbolicFile &Obj, bool printName, HFlags & MachO::MH_NLIST_OUTOFSYNC_WITH_DYLDINFO) { unsigned ExportsAdded = 0; Error Err = Error::success(); - for (const llvm::object::ExportEntry &Entry : MachO->exports(Err, - MachO)) { + for (const llvm::object::ExportEntry &Entry : MachO->exports(Err)) { bool found = false; bool ReExport = false; if (!DyldInfoOnly) { diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp index 31a3f66..b708148 100644 --- a/llvm/tools/llvm-objdump/MachODump.cpp +++ b/llvm/tools/llvm-objdump/MachODump.cpp @@ -9403,7 +9403,7 @@ void llvm::printMachOExportsTrie(const object::MachOObjectFile *Obj) { } } Error Err = Error::success(); - for (const llvm::object::ExportEntry &Entry : Obj->exports(Err, Obj)) { + for (const llvm::object::ExportEntry &Entry : Obj->exports(Err)) { uint64_t Flags = Entry.flags(); bool ReExport = (Flags & MachO::EXPORT_SYMBOL_FLAGS_REEXPORT); bool WeakDef = (Flags & MachO::EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION);