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
basic_symbol_iterator symbol_end() const override;
// MachO specific.
- basic_symbol_iterator getSymbolByIndex(unsigned Index) const;
+ symbol_iterator getSymbolByIndex(unsigned Index) const;
uint64_t getSymbolIndex(DataRefImpl Symb) const;
section_iterator section_begin() const override;
return basic_symbol_iterator(SymbolRef(DRI, this));
}
-basic_symbol_iterator MachOObjectFile::getSymbolByIndex(unsigned Index) const {
+symbol_iterator MachOObjectFile::getSymbolByIndex(unsigned Index) const {
MachO::symtab_command Symtab = getSymtabLoadCommand();
if (!SymtabLoadCmd || Index >= Symtab.nsyms)
report_fatal_error("Requested symbol index is out of range.");