summaryrefslogtreecommitdiff
path: root/tools/macho-dump
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2014-03-17 07:28:19 +0000
committerAlexey Samsonov <samsonov@google.com>2014-03-17 07:28:19 +0000
commit133aacf0dd1d7d8c7828594e5cd2e9595e0331ed (patch)
treec23ad0adb1e11ad755918cc3c24bd740a85b5c55 /tools/macho-dump
parent6e3aceffd39eb8f7e750b5a8364269fc8efc0e53 (diff)
[C++11] Introduce ObjectFile::symbols() to use range-based loops.
Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3081 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204031 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/macho-dump')
-rw-r--r--tools/macho-dump/macho-dump.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/macho-dump/macho-dump.cpp b/tools/macho-dump/macho-dump.cpp
index 9cfbdfb1b18..beeef5b1767 100644
--- a/tools/macho-dump/macho-dump.cpp
+++ b/tools/macho-dump/macho-dump.cpp
@@ -202,9 +202,8 @@ static int DumpSymtabCommand(const MachOObjectFile &Obj) {
// Dump the symbol table.
outs() << " ('_symbols', [\n";
unsigned SymNum = 0;
- for (symbol_iterator I = Obj.symbol_begin(), E = Obj.symbol_end(); I != E;
- ++I, ++SymNum) {
- DataRefImpl DRI = I->getRawDataRefImpl();
+ for (const SymbolRef &Symbol : Obj.symbols()) {
+ DataRefImpl DRI = Symbol.getRawDataRefImpl();
if (Obj.is64Bit()) {
MachO::nlist_64 STE = Obj.getSymbol64TableEntry(DRI);
DumpSymbolTableEntryData(Obj, SymNum, STE.n_strx, STE.n_type,
@@ -216,6 +215,7 @@ static int DumpSymtabCommand(const MachOObjectFile &Obj) {
STE.n_sect, STE.n_desc, STE.n_value,
StringTable);
}
+ SymNum++;
}
outs() << " ])\n";