From 46f0a97e2c30f4d457eb9b456ee6e1cd864369d8 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Mon, 14 Jan 2019 22:05:12 +0000 Subject: [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. llvm-svn: 351128 --- llvm/lib/Object/MachOObjectFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Object/MachOObjectFile.cpp') diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index 86f29365273..ce4d1cf92e2 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -2438,7 +2438,7 @@ basic_symbol_iterator MachOObjectFile::symbol_end() const { 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."); -- cgit v1.2.3