summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-02-10 20:24:04 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-02-10 20:24:04 +0000
commita40b3522c82f5684a8a2c59a631b8c445288f6e1 (patch)
tree86bbfc7434be05fc970615da9f80a810b100c9d8 /tools
parent700bba297ba8a99c5dfd31ceaa894fbd1496a03e (diff)
downloadllvm-a40b3522c82f5684a8a2c59a631b8c445288f6e1.tar.gz
llvm-a40b3522c82f5684a8a2c59a631b8c445288f6e1.tar.bz2
llvm-a40b3522c82f5684a8a2c59a631b8c445288f6e1.tar.xz
Change the begin and end methods in ObjectFile to match the style guide.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201108 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-ar/llvm-ar.cpp4
-rw-r--r--tools/llvm-nm/llvm-nm.cpp24
-rw-r--r--tools/llvm-objdump/COFFDump.cpp8
-rw-r--r--tools/llvm-objdump/MachODump.cpp12
-rw-r--r--tools/llvm-objdump/llvm-objdump.cpp30
-rw-r--r--tools/llvm-readobj/COFFDumper.cpp36
-rw-r--r--tools/llvm-readobj/MachODumper.cpp28
-rw-r--r--tools/llvm-size/llvm-size.cpp6
-rw-r--r--tools/llvm-symbolizer/LLVMSymbolize.cpp4
-rw-r--r--tools/macho-dump/macho-dump.cpp2
-rw-r--r--tools/obj2yaml/coff2yaml.cpp12
11 files changed, 83 insertions, 83 deletions
diff --git a/tools/llvm-ar/llvm-ar.cpp b/tools/llvm-ar/llvm-ar.cpp
index 1a1fd8a483..bc9ad37e5d 100644
--- a/tools/llvm-ar/llvm-ar.cpp
+++ b/tools/llvm-ar/llvm-ar.cpp
@@ -716,8 +716,8 @@ static void writeSymbolTable(
print32BE(Out, 0);
}
- for (object::symbol_iterator I = Obj->begin_symbols(),
- E = Obj->end_symbols();
+ for (object::symbol_iterator I = Obj->symbol_begin(),
+ E = Obj->symbol_end();
I != E; ++I) {
uint32_t Symflags = I->getFlags();;
if (Symflags & object::SymbolRef::SF_FormatSpecific)
diff --git a/tools/llvm-nm/llvm-nm.cpp b/tools/llvm-nm/llvm-nm.cpp
index 3a72862776..fd18454a8f 100644
--- a/tools/llvm-nm/llvm-nm.cpp
+++ b/tools/llvm-nm/llvm-nm.cpp
@@ -365,7 +365,7 @@ static char getSymbolNMTypeChar(COFFObjectFile &Obj, symbol_iterator I) {
uint32_t Characteristics = 0;
if (Symb->SectionNumber > 0) {
- section_iterator SecI = Obj.end_sections();
+ section_iterator SecI = Obj.section_end();
if (error(I->getSection(SecI)))
return '?';
const coff_section *Section = Obj.getCOFFSection(SecI);
@@ -415,7 +415,7 @@ static char getSymbolNMTypeChar(MachOObjectFile &Obj, symbol_iterator I) {
case MachO::N_ABS:
return 's';
case MachO::N_SECT: {
- section_iterator Sec = Obj.end_sections();
+ section_iterator Sec = Obj.section_end();
Obj.getSymbolSection(Symb, Sec);
DataRefImpl Ref = Sec->getRawDataRefImpl();
StringRef SectionName;
@@ -493,29 +493,29 @@ static char getNMTypeChar(ObjectFile *Obj, symbol_iterator I) {
static void getDynamicSymbolIterators(ObjectFile *Obj, symbol_iterator &Begin,
symbol_iterator &End) {
if (ELF32LEObjectFile *ELF = dyn_cast<ELF32LEObjectFile>(Obj)) {
- Begin = ELF->begin_dynamic_symbols();
- End = ELF->end_dynamic_symbols();
+ Begin = ELF->dynamic_symbol_begin();
+ End = ELF->dynamic_symbol_end();
return;
}
if (ELF64LEObjectFile *ELF = dyn_cast<ELF64LEObjectFile>(Obj)) {
- Begin = ELF->begin_dynamic_symbols();
- End = ELF->end_dynamic_symbols();
+ Begin = ELF->dynamic_symbol_begin();
+ End = ELF->dynamic_symbol_end();
return;
}
if (ELF32BEObjectFile *ELF = dyn_cast<ELF32BEObjectFile>(Obj)) {
- Begin = ELF->begin_dynamic_symbols();
- End = ELF->end_dynamic_symbols();
+ Begin = ELF->dynamic_symbol_begin();
+ End = ELF->dynamic_symbol_end();
return;
}
ELF64BEObjectFile *ELF = cast<ELF64BEObjectFile>(Obj);
- Begin = ELF->begin_dynamic_symbols();
- End = ELF->end_dynamic_symbols();
+ Begin = ELF->dynamic_symbol_begin();
+ End = ELF->dynamic_symbol_end();
return;
}
static void dumpSymbolNamesFromObject(ObjectFile *Obj) {
- symbol_iterator IBegin = Obj->begin_symbols();
- symbol_iterator IEnd = Obj->end_symbols();
+ symbol_iterator IBegin = Obj->symbol_begin();
+ symbol_iterator IEnd = Obj->symbol_end();
if (DynamicSyms) {
if (!Obj->isELF()) {
error("File format has no dynamic symbol table", Obj->getFileName());
diff --git a/tools/llvm-objdump/COFFDump.cpp b/tools/llvm-objdump/COFFDump.cpp
index dd2db2b037..f6f0f15197 100644
--- a/tools/llvm-objdump/COFFDump.cpp
+++ b/tools/llvm-objdump/COFFDump.cpp
@@ -163,7 +163,7 @@ static error_code resolveSectionAndAddress(const COFFObjectFile *Obj,
uint64_t &ResolvedAddr) {
if (error_code EC = Sym.getAddress(ResolvedAddr))
return EC;
- section_iterator iter(Obj->begin_sections());
+ section_iterator iter(Obj->section_begin());
if (error_code EC = Sym.getSection(iter))
return EC;
ResolvedSection = Obj->getCOFFSection(iter);
@@ -320,7 +320,7 @@ void llvm::printCOFFUnwindInfo(const COFFObjectFile *Obj) {
const coff_section *Pdata = 0;
- for (section_iterator SI = Obj->begin_sections(), SE = Obj->end_sections();
+ for (section_iterator SI = Obj->section_begin(), SE = Obj->section_end();
SI != SE; ++SI) {
StringRef Name;
if (error(SI->getName(Name))) continue;
@@ -329,8 +329,8 @@ void llvm::printCOFFUnwindInfo(const COFFObjectFile *Obj) {
Pdata = Obj->getCOFFSection(SI);
std::vector<RelocationRef> Rels;
- for (relocation_iterator RI = SI->begin_relocations(),
- RE = SI->end_relocations();
+ for (relocation_iterator RI = SI->relocation_begin(),
+ RE = SI->relocation_end();
RI != RE; ++RI)
Rels.push_back(*RI);
diff --git a/tools/llvm-objdump/MachODump.cpp b/tools/llvm-objdump/MachODump.cpp
index b8ce9c884a..35e424d60b 100644
--- a/tools/llvm-objdump/MachODump.cpp
+++ b/tools/llvm-objdump/MachODump.cpp
@@ -154,13 +154,13 @@ getSectionsAndSymbols(const MachO::mach_header Header,
std::vector<SymbolRef> &Symbols,
SmallVectorImpl<uint64_t> &FoundFns,
uint64_t &BaseSegmentAddress) {
- for (symbol_iterator SI = MachOObj->begin_symbols(),
- SE = MachOObj->end_symbols();
+ for (symbol_iterator SI = MachOObj->symbol_begin(),
+ SE = MachOObj->symbol_end();
SI != SE; ++SI)
Symbols.push_back(*SI);
- for (section_iterator SI = MachOObj->begin_sections(),
- SE = MachOObj->end_sections();
+ for (section_iterator SI = MachOObj->section_begin(),
+ SE = MachOObj->section_end();
SI != SE; ++SI) {
SectionRef SR = *SI;
StringRef SectName;
@@ -329,8 +329,8 @@ static void DisassembleInputMachO2(StringRef Filename,
// Parse relocations.
std::vector<std::pair<uint64_t, SymbolRef> > Relocs;
- for (relocation_iterator RI = Sections[SectIdx].begin_relocations(),
- RE = Sections[SectIdx].end_relocations();
+ for (relocation_iterator RI = Sections[SectIdx].relocation_begin(),
+ RE = Sections[SectIdx].relocation_end();
RI != RE; ++RI) {
uint64_t RelocOffset, SectionAddress;
RI->getOffset(RelocOffset);
diff --git a/tools/llvm-objdump/llvm-objdump.cpp b/tools/llvm-objdump/llvm-objdump.cpp
index 4572c96548..3b87507af0 100644
--- a/tools/llvm-objdump/llvm-objdump.cpp
+++ b/tools/llvm-objdump/llvm-objdump.cpp
@@ -386,14 +386,14 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
// in RelocSecs contain the relocations for section S.
error_code EC;
std::map<SectionRef, SmallVector<SectionRef, 1> > SectionRelocMap;
- for (section_iterator I = Obj->begin_sections(), E = Obj->end_sections();
+ for (section_iterator I = Obj->section_begin(), E = Obj->section_end();
I != E; ++I) {
section_iterator Sec2 = I->getRelocatedSection();
- if (Sec2 != Obj->end_sections())
+ if (Sec2 != Obj->section_end())
SectionRelocMap[*Sec2].push_back(*I);
}
- for (section_iterator I = Obj->begin_sections(), E = Obj->end_sections();
+ for (section_iterator I = Obj->section_begin(), E = Obj->section_end();
I != E; ++I) {
bool Text;
if (error(I->isText(Text)))
@@ -407,7 +407,7 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
// Make a list of all the symbols in this section.
std::vector<std::pair<uint64_t, StringRef> > Symbols;
- for (symbol_iterator SI = Obj->begin_symbols(), SE = Obj->end_symbols();
+ for (symbol_iterator SI = Obj->symbol_begin(), SE = Obj->symbol_end();
SI != SE; ++SI) {
bool contains;
if (!error(I->containsSymbol(*SI, contains)) && contains) {
@@ -435,8 +435,8 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
for (SmallVectorImpl<SectionRef>::iterator RelocSec = RelocSecs->begin(),
E = RelocSecs->end();
RelocSec != E; ++RelocSec) {
- for (relocation_iterator RI = RelocSec->begin_relocations(),
- RE = RelocSec->end_relocations();
+ for (relocation_iterator RI = RelocSec->relocation_begin(),
+ RE = RelocSec->relocation_end();
RI != RE; ++RI)
Rels.push_back(*RI);
}
@@ -552,15 +552,15 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
}
static void PrintRelocations(const ObjectFile *o) {
- for (section_iterator si = o->begin_sections(), se = o->end_sections();
+ for (section_iterator si = o->section_begin(), se = o->section_end();
si != se; ++si) {
- if (si->begin_relocations() == si->end_relocations())
+ if (si->relocation_begin() == si->relocation_end())
continue;
StringRef secname;
if (error(si->getName(secname))) continue;
outs() << "RELOCATION RECORDS FOR [" << secname << "]:\n";
- for (relocation_iterator ri = si->begin_relocations(),
- re = si->end_relocations();
+ for (relocation_iterator ri = si->relocation_begin(),
+ re = si->relocation_end();
ri != re; ++ri) {
bool hidden;
uint64_t address;
@@ -581,7 +581,7 @@ static void PrintSectionHeaders(const ObjectFile *o) {
outs() << "Sections:\n"
"Idx Name Size Address Type\n";
unsigned i = 0;
- for (section_iterator si = o->begin_sections(), se = o->end_sections();
+ for (section_iterator si = o->section_begin(), se = o->section_end();
si != se; ++si) {
StringRef Name;
if (error(si->getName(Name)))
@@ -604,7 +604,7 @@ static void PrintSectionHeaders(const ObjectFile *o) {
static void PrintSectionContents(const ObjectFile *o) {
error_code EC;
- for (section_iterator si = o->begin_sections(), se = o->end_sections();
+ for (section_iterator si = o->section_begin(), se = o->section_end();
si != se; ++si) {
StringRef Name;
StringRef Contents;
@@ -696,14 +696,14 @@ static void PrintSymbolTable(const ObjectFile *o) {
if (const COFFObjectFile *coff = dyn_cast<const COFFObjectFile>(o))
PrintCOFFSymbolTable(coff);
else {
- for (symbol_iterator si = o->begin_symbols(), se = o->end_symbols();
+ for (symbol_iterator si = o->symbol_begin(), se = o->symbol_end();
si != se; ++si) {
StringRef Name;
uint64_t Address;
SymbolRef::Type Type;
uint64_t Size;
uint32_t Flags = si->getFlags();
- section_iterator Section = o->end_sections();
+ section_iterator Section = o->section_end();
if (error(si->getName(Name))) continue;
if (error(si->getAddress(Address))) continue;
if (error(si->getType(Type))) continue;
@@ -743,7 +743,7 @@ static void PrintSymbolTable(const ObjectFile *o) {
<< ' ';
if (Absolute)
outs() << "*ABS*";
- else if (Section == o->end_sections())
+ else if (Section == o->section_end())
outs() << "*UND*";
else {
if (const MachOObjectFile *MachO =
diff --git a/tools/llvm-readobj/COFFDumper.cpp b/tools/llvm-readobj/COFFDumper.cpp
index 08153ebd04..120794280d 100644
--- a/tools/llvm-readobj/COFFDumper.cpp
+++ b/tools/llvm-readobj/COFFDumper.cpp
@@ -185,7 +185,7 @@ static error_code resolveSectionAndAddress(const COFFObjectFile *Obj,
if (error_code EC = Sym.getAddress(ResolvedAddr))
return EC;
- section_iterator iter(Obj->begin_sections());
+ section_iterator iter(Obj->section_begin());
if (error_code EC = Sym.getSection(iter))
return EC;
@@ -541,13 +541,13 @@ error_code COFFDumper::getSection(
}
void COFFDumper::cacheRelocations() {
- for (section_iterator SecI = Obj->begin_sections(),
- SecE = Obj->end_sections();
+ for (section_iterator SecI = Obj->section_begin(),
+ SecE = Obj->section_end();
SecI != SecE; ++SecI) {
const coff_section *Section = Obj->getCOFFSection(SecI);
- for (relocation_iterator RelI = SecI->begin_relocations(),
- RelE = SecI->end_relocations();
+ for (relocation_iterator RelI = SecI->relocation_begin(),
+ RelE = SecI->relocation_end();
RelI != RelE; ++RelI)
RelocMap[Section].push_back(*RelI);
@@ -818,8 +818,8 @@ void COFFDumper::printCodeViewLineTables(section_iterator SecI) {
void COFFDumper::printSections() {
ListScope SectionsD(W, "Sections");
int SectionNumber = 0;
- for (section_iterator SecI = Obj->begin_sections(),
- SecE = Obj->end_sections();
+ for (section_iterator SecI = Obj->section_begin(),
+ SecE = Obj->section_end();
SecI != SecE; ++SecI) {
++SectionNumber;
const coff_section *Section = Obj->getCOFFSection(SecI);
@@ -845,16 +845,16 @@ void COFFDumper::printSections() {
if (opts::SectionRelocations) {
ListScope D(W, "Relocations");
- for (relocation_iterator RelI = SecI->begin_relocations(),
- RelE = SecI->end_relocations();
+ for (relocation_iterator RelI = SecI->relocation_begin(),
+ RelE = SecI->relocation_end();
RelI != RelE; ++RelI)
printRelocation(SecI, RelI);
}
if (opts::SectionSymbols) {
ListScope D(W, "Symbols");
- for (symbol_iterator SymI = Obj->begin_symbols(),
- SymE = Obj->end_symbols();
+ for (symbol_iterator SymI = Obj->symbol_begin(),
+ SymE = Obj->symbol_end();
SymI != SymE; ++SymI) {
bool Contained = false;
if (SecI->containsSymbol(*SymI, Contained) || !Contained)
@@ -880,8 +880,8 @@ void COFFDumper::printRelocations() {
ListScope D(W, "Relocations");
int SectionNumber = 0;
- for (section_iterator SecI = Obj->begin_sections(),
- SecE = Obj->end_sections();
+ for (section_iterator SecI = Obj->section_begin(),
+ SecE = Obj->section_end();
SecI != SecE; ++SecI) {
++SectionNumber;
StringRef Name;
@@ -889,8 +889,8 @@ void COFFDumper::printRelocations() {
continue;
bool PrintedGroup = false;
- for (relocation_iterator RelI = SecI->begin_relocations(),
- RelE = SecI->end_relocations();
+ for (relocation_iterator RelI = SecI->relocation_begin(),
+ RelE = SecI->relocation_end();
RelI != RelE; ++RelI) {
if (!PrintedGroup) {
W.startLine() << "Section (" << SectionNumber << ") " << Name << " {\n";
@@ -939,7 +939,7 @@ void COFFDumper::printRelocation(section_iterator SecI,
void COFFDumper::printSymbols() {
ListScope Group(W, "Symbols");
- for (symbol_iterator SymI = Obj->begin_symbols(), SymE = Obj->end_symbols();
+ for (symbol_iterator SymI = Obj->symbol_begin(), SymE = Obj->symbol_end();
SymI != SymE; ++SymI)
printSymbol(SymI);
}
@@ -1087,8 +1087,8 @@ void COFFDumper::printUnwindInfo() {
}
void COFFDumper::printX64UnwindInfo() {
- for (section_iterator SecI = Obj->begin_sections(),
- SecE = Obj->end_sections();
+ for (section_iterator SecI = Obj->section_begin(),
+ SecE = Obj->section_end();
SecI != SecE; ++SecI) {
StringRef Name;
if (error(SecI->getName(Name)))
diff --git a/tools/llvm-readobj/MachODumper.cpp b/tools/llvm-readobj/MachODumper.cpp
index af76901a3f..ef699b30bf 100644
--- a/tools/llvm-readobj/MachODumper.cpp
+++ b/tools/llvm-readobj/MachODumper.cpp
@@ -222,8 +222,8 @@ void MachODumper::printSections(const MachOObjectFile *Obj) {
ListScope Group(W, "Sections");
int SectionIndex = -1;
- for (section_iterator SecI = Obj->begin_sections(),
- SecE = Obj->end_sections();
+ for (section_iterator SecI = Obj->section_begin(),
+ SecE = Obj->section_end();
SecI != SecE; ++SecI) {
++SectionIndex;
@@ -258,16 +258,16 @@ void MachODumper::printSections(const MachOObjectFile *Obj) {
if (opts::SectionRelocations) {
ListScope D(W, "Relocations");
- for (relocation_iterator RelI = SecI->begin_relocations(),
- RelE = SecI->end_relocations();
+ for (relocation_iterator RelI = SecI->relocation_begin(),
+ RelE = SecI->relocation_end();
RelI != RelE; ++RelI)
printRelocation(SecI, RelI);
}
if (opts::SectionSymbols) {
ListScope D(W, "Symbols");
- for (symbol_iterator SymI = Obj->begin_symbols(),
- SymE = Obj->end_symbols();
+ for (symbol_iterator SymI = Obj->symbol_begin(),
+ SymE = Obj->symbol_end();
SymI != SymE; ++SymI) {
bool Contained = false;
if (SecI->containsSymbol(*SymI, Contained) || !Contained)
@@ -290,16 +290,16 @@ void MachODumper::printRelocations() {
ListScope D(W, "Relocations");
error_code EC;
- for (section_iterator SecI = Obj->begin_sections(),
- SecE = Obj->end_sections();
+ for (section_iterator SecI = Obj->section_begin(),
+ SecE = Obj->section_end();
SecI != SecE; ++SecI) {
StringRef Name;
if (error(SecI->getName(Name)))
continue;
bool PrintedGroup = false;
- for (relocation_iterator RelI = SecI->begin_relocations(),
- RelE = SecI->end_relocations();
+ for (relocation_iterator RelI = SecI->relocation_begin(),
+ RelE = SecI->relocation_end();
RelI != RelE; ++RelI) {
if (!PrintedGroup) {
W.startLine() << "Section " << Name << " {\n";
@@ -331,7 +331,7 @@ void MachODumper::printRelocation(const MachOObjectFile *Obj,
if (error(RelI->getOffset(Offset))) return;
if (error(RelI->getTypeName(RelocName))) return;
symbol_iterator Symbol = RelI->getSymbol();
- if (Symbol != Obj->end_symbols() &&
+ if (Symbol != Obj->symbol_end() &&
error(Symbol->getName(SymbolName)))
return;
@@ -370,7 +370,7 @@ void MachODumper::printRelocation(const MachOObjectFile *Obj,
void MachODumper::printSymbols() {
ListScope Group(W, "Symbols");
- for (symbol_iterator SymI = Obj->begin_symbols(), SymE = Obj->end_symbols();
+ for (symbol_iterator SymI = Obj->symbol_begin(), SymE = Obj->symbol_end();
SymI != SymE; ++SymI) {
printSymbol(SymI);
}
@@ -389,9 +389,9 @@ void MachODumper::printSymbol(symbol_iterator SymI) {
getSymbol(Obj, SymI->getRawDataRefImpl(), Symbol);
StringRef SectionName = "";
- section_iterator SecI(Obj->end_sections());
+ section_iterator SecI(Obj->section_begin());
if (!error(SymI->getSection(SecI)) &&
- SecI != Obj->end_sections())
+ SecI != Obj->section_end())
error(SecI->getName(SectionName));
DictScope D(W, "Symbol");
diff --git a/tools/llvm-size/llvm-size.cpp b/tools/llvm-size/llvm-size.cpp
index f46bf6b4a2..c2d2446275 100644
--- a/tools/llvm-size/llvm-size.cpp
+++ b/tools/llvm-size/llvm-size.cpp
@@ -111,7 +111,7 @@ static void PrintObjectSectionSizes(ObjectFile *o) {
std::size_t max_name_len = strlen("section");
std::size_t max_size_len = strlen("size");
std::size_t max_addr_len = strlen("addr");
- for (section_iterator i = o->begin_sections(), e = o->end_sections();
+ for (section_iterator i = o->section_begin(), e = o->section_end();
i != e; ++i) {
uint64_t size = 0;
if (error(i->getSize(size)))
@@ -150,7 +150,7 @@ static void PrintObjectSectionSizes(ObjectFile *o) {
<< "%#" << max_addr_len << radix_fmt << "\n";
// Print each section.
- for (section_iterator i = o->begin_sections(), e = o->end_sections();
+ for (section_iterator i = o->section_begin(), e = o->section_end();
i != e; ++i) {
StringRef name;
uint64_t size = 0;
@@ -181,7 +181,7 @@ static void PrintObjectSectionSizes(ObjectFile *o) {
uint64_t total_bss = 0;
// Make one pass over the section table to calculate sizes.
- for (section_iterator i = o->begin_sections(), e = o->end_sections();
+ for (section_iterator i = o->section_begin(), e = o->section_end();
i != e; ++i) {
uint64_t size = 0;
bool isText = false;
diff --git a/tools/llvm-symbolizer/LLVMSymbolize.cpp b/tools/llvm-symbolizer/LLVMSymbolize.cpp
index 4075199857..9f329a6de6 100644
--- a/tools/llvm-symbolizer/LLVMSymbolize.cpp
+++ b/tools/llvm-symbolizer/LLVMSymbolize.cpp
@@ -52,7 +52,7 @@ static void patchFunctionNameInDILineInfo(const std::string &NewFunctionName,
ModuleInfo::ModuleInfo(ObjectFile *Obj, DIContext *DICtx)
: Module(Obj), DebugInfoContext(DICtx) {
- for (symbol_iterator si = Module->begin_symbols(), se = Module->end_symbols();
+ for (symbol_iterator si = Module->symbol_begin(), se = Module->symbol_end();
si != se; ++si) {
SymbolRef::Type SymbolType;
if (error(si->getType(SymbolType)))
@@ -265,7 +265,7 @@ static bool getGNUDebuglinkContents(const Binary *Bin, std::string &DebugName,
const ObjectFile *Obj = dyn_cast<ObjectFile>(Bin);
if (!Obj)
return false;
- for (section_iterator I = Obj->begin_sections(), E = Obj->end_sections();
+ for (section_iterator I = Obj->section_begin(), E = Obj->section_end();
I != E; ++I) {
StringRef Name;
I->getName(Name);
diff --git a/tools/macho-dump/macho-dump.cpp b/tools/macho-dump/macho-dump.cpp
index f2f4b8c70f..dbb2700b77 100644
--- a/tools/macho-dump/macho-dump.cpp
+++ b/tools/macho-dump/macho-dump.cpp
@@ -202,7 +202,7 @@ static int DumpSymtabCommand(const MachOObjectFile &Obj) {
// Dump the symbol table.
outs() << " ('_symbols', [\n";
unsigned SymNum = 0;
- for (symbol_iterator I = Obj.begin_symbols(), E = Obj.end_symbols(); I != E;
+ for (symbol_iterator I = Obj.symbol_begin(), E = Obj.symbol_end(); I != E;
++I, ++SymNum) {
DataRefImpl DRI = I->getRawDataRefImpl();
if (Obj.is64Bit()) {
diff --git a/tools/obj2yaml/coff2yaml.cpp b/tools/obj2yaml/coff2yaml.cpp
index 47ccfb7700..8fdd4aee0c 100644
--- a/tools/obj2yaml/coff2yaml.cpp
+++ b/tools/obj2yaml/coff2yaml.cpp
@@ -51,8 +51,8 @@ void COFFDumper::dumpHeader(const object::coff_file_header *Header) {
void COFFDumper::dumpSections(unsigned NumSections) {
std::vector<COFFYAML::Section> &Sections = YAMLObj.Sections;
- for (object::section_iterator iter = Obj.begin_sections();
- iter != Obj.end_sections(); ++iter) {
+ for (object::section_iterator iter = Obj.section_begin();
+ iter != Obj.section_end(); ++iter) {
const object::coff_section *Sect = Obj.getCOFFSection(iter);
COFFYAML::Section Sec;
Sec.Name = Sect->Name; // FIXME: check the null termination!
@@ -65,8 +65,8 @@ void COFFDumper::dumpSections(unsigned NumSections) {
Sec.SectionData = object::yaml::BinaryRef(sectionData);
std::vector<COFFYAML::Relocation> Relocations;
- for (object::relocation_iterator rIter = iter->begin_relocations();
- rIter != iter->end_relocations(); ++rIter) {
+ for (object::relocation_iterator rIter = iter->relocation_begin();
+ rIter != iter->relocation_end(); ++rIter) {
const object::coff_relocation *reloc = Obj.getCOFFRelocation(rIter);
COFFYAML::Relocation Rel;
object::symbol_iterator Sym = rIter->getSymbol();
@@ -82,8 +82,8 @@ void COFFDumper::dumpSections(unsigned NumSections) {
void COFFDumper::dumpSymbols(unsigned NumSymbols) {
std::vector<COFFYAML::Symbol> &Symbols = YAMLObj.Symbols;
- for (object::symbol_iterator iter = Obj.begin_symbols();
- iter != Obj.end_symbols(); ++iter) {
+ for (object::symbol_iterator iter = Obj.symbol_begin();
+ iter != Obj.symbol_end(); ++iter) {
const object::coff_symbol *Symbol = Obj.getCOFFSymbol(iter);
COFFYAML::Symbol Sym;
Obj.getSymbolName(Symbol, Sym.Name);