<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 27, 2017, at 9:50 PM, Saleem Abdulrasool via Phabricator <<a href="mailto:reviews@reviews.llvm.org" class="">reviews@reviews.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">compnerd added a comment.<br class=""><br class="">Does anyone use the overload with the `O` for `exports` with `nullptr` instead of `this`?  If not, we could just inline `this` throughout.<br class=""></div></div></blockquote><div><br class=""></div>This will break lld as it needs the default nullptr.  See <span style="font-family: 'Helvetica Neue';" class="">r308691.</span></div><div><span style="font-family: 'Helvetica Neue';" class=""><br class=""></span></div><div><span style="font-family: 'Helvetica Neue';" class="">The reason that O was added was so that this check from r</span>308690 could be added.</div><div><span style="font-family: 'Helvetica Neue';" class=""><br class=""></span></div><div>+      if (O != nullptr) {<br class="">+        if (State.Other > O->getLibraryCount()) {<br class="">+          *E = malformedError("bad library ordinal: " + Twine((int)State.Other)<br class="">+               + " (max " + Twine((int)O->getLibraryCount()) + ") in export "<br class="">+               "trie data at node: 0x" + utohexstr(offset));<br class="">+          moveToEnd();<br class="">+          return;<br class="">+        }</div><div><br class=""></div><div>This is needed for the test case:</div><div><br class=""></div><div>+RUN: not llvm-objdump -macho -exports-trie %p/Inputs/macho-trie-bad-library-ordinal 2>&1 | FileCheck -check-prefix BAD_LIBRARY_ORDINAL %s <br class="">+BAD_LIBRARY_ORDINAL: macho-trie-bad-library-ordinal': truncated or malformed object (bad library ordinal: 69 (max 3) in export trie data at node: 0x33)</div><div><font face="Helvetica Neue" class=""><br class=""></font><blockquote type="cite" class=""><div class=""><div class=""><br class=""><br class=""><br class="">================<br class="">Comment at: tools/llvm-nm/llvm-nm.cpp:1230<br class="">       Error Err = Error::success();<br class="">-      for (const llvm::object::ExportEntry &Entry : MachO->exports(Err,<br class="">-                                                                   MachO)) {<br class="">+      for (const llvm::object::ExportEntry &Entry : MachO->exports(Err)) {<br class="">         bool found = false;<br class="">----------------<br class="">I think that using `auto` here instead of `llvm::object:ExportEntry` is better for readability.<br class=""><br class=""><br class="">================<br class="">Comment at: tools/llvm-objdump/MachODump.cpp:9406<br class="">   Error Err = Error::success();<br class="">-  for (const llvm::object::ExportEntry &Entry : Obj->exports(Err, Obj)) {<br class="">+  for (const llvm::object::ExportEntry &Entry : Obj->exports(Err)) {<br class="">     uint64_t Flags = Entry.flags();<br class="">----------------<br class="">Similar.<br class=""><br class=""><br class="">Repository:<br class="">  rL LLVM<br class=""><br class=""><a href="https://reviews.llvm.org/D35961" class="">https://reviews.llvm.org/D35961</a><br class=""><br class=""><br class=""><br class=""></div></div></blockquote></div><br class=""></body></html>