[PATCH] D35961: [llvm] Update MachOObjectFile::exports interface
Alexander Shaposhnikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 27 16:22:56 PDT 2017
alexshap created this revision.
This diff removes the second argument of the method
MachOObjectFile::exports which was recently introduced in r308690.
In all in-tree uses this argument is equal to "this", additionally
without this argument the interface seems to be cleaner.
Test plan: make check-all
Repository:
rL LLVM
https://reviews.llvm.org/D35961
Files:
include/llvm/Object/MachO.h
lib/Object/MachOObjectFile.cpp
tools/llvm-nm/llvm-nm.cpp
tools/llvm-objdump/MachODump.cpp
Index: tools/llvm-objdump/MachODump.cpp
===================================================================
--- tools/llvm-objdump/MachODump.cpp
+++ tools/llvm-objdump/MachODump.cpp
@@ -9403,7 +9403,7 @@
}
}
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);
Index: tools/llvm-nm/llvm-nm.cpp
===================================================================
--- tools/llvm-nm/llvm-nm.cpp
+++ tools/llvm-nm/llvm-nm.cpp
@@ -1227,8 +1227,7 @@
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) {
Index: lib/Object/MachOObjectFile.cpp
===================================================================
--- lib/Object/MachOObjectFile.cpp
+++ lib/Object/MachOObjectFile.cpp
@@ -2908,9 +2908,8 @@
return make_range(export_iterator(Start), export_iterator(Finish));
}
-iterator_range<export_iterator> MachOObjectFile::exports(Error &Err,
- const MachOObjectFile *O) const {
- return exports(Err, getDyldInfoExportsTrie(), O);
+iterator_range<export_iterator> MachOObjectFile::exports(Error &Err) const {
+ return exports(Err, getDyldInfoExportsTrie(), this);
}
MachORebaseEntry::MachORebaseEntry(Error *E, const MachOObjectFile *O,
Index: include/llvm/Object/MachO.h
===================================================================
--- include/llvm/Object/MachO.h
+++ include/llvm/Object/MachO.h
@@ -365,8 +365,7 @@
iterator_range<load_command_iterator> load_commands() const;
/// For use iterating over all exported symbols.
- iterator_range<export_iterator> exports(Error &Err,
- const MachOObjectFile *O) const;
+ iterator_range<export_iterator> exports(Error &Err) const;
/// For use examining a trie not in a MachOObjectFile.
static iterator_range<export_iterator> exports(Error &Err,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35961.108542.patch
Type: text/x-patch
Size: 2503 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170727/3814644c/attachment.bin>
More information about the llvm-commits
mailing list