summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/MachOObjectFile.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2019-01-14 22:05:12 +0000
committerLang Hames <lhames@gmail.com>2019-01-14 22:05:12 +0000
commit46f0a97e2c30f4d457eb9b456ee6e1cd864369d8 (patch)
treea5bd1acd830bfaa22120830af65a46a2d7a3d971 /llvm/lib/Object/MachOObjectFile.cpp
parent2a47e03ee4779b2b2c640c6ae3c0c91fef8c9fe6 (diff)
downloadbcm5719-llvm-46f0a97e2c30f4d457eb9b456ee6e1cd864369d8.tar.gz
bcm5719-llvm-46f0a97e2c30f4d457eb9b456ee6e1cd864369d8.zip
[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
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r--llvm/lib/Object/MachOObjectFile.cpp2
1 files changed, 1 insertions, 1 deletions
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.");
OpenPOWER on IntegriCloud