llvm.org GIT mirror llvm / d2d60da
[Object] Return a symbol_iterator, rather than a basic_symbol_iterator, from MachOObjectFile::getSymbolByIndex. ObjectFile derivatives should prefer symbol_iterator/SymbolRef over basic_symbol_iterator/BasicSymbolRef where possible, as the former retain their link to the ObjectFile (rather than a SymbolicFile) and provide more functionality. No test for this: Existing code is working, and we don't have (m)any libObject unit tests. I'll think about how we can test more systematically going forward. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351128 91177308-0d34-0410-b5e6-96231b3b80d8 Lang Hames 1 year, 10 months ago
2 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
355355 basic_symbol_iterator symbol_end() const override;
356356
357357 // MachO specific.
358 basic_symbol_iterator getSymbolByIndex(unsigned Index) const;
358 symbol_iterator getSymbolByIndex(unsigned Index) const;
359359 uint64_t getSymbolIndex(DataRefImpl Symb) const;
360360
361361 section_iterator section_begin() const override;
24372437 return basic_symbol_iterator(SymbolRef(DRI, this));
24382438 }
24392439
2440 basic_symbol_iterator MachOObjectFile::getSymbolByIndex(unsigned Index) const {
2440 symbol_iterator MachOObjectFile::getSymbolByIndex(unsigned Index) const {
24412441 MachO::symtab_command Symtab = getSymtabLoadCommand();
24422442 if (!SymtabLoadCmd || Index >= Symtab.nsyms)
24432443 report_fatal_error("Requested symbol index is out of range.");