summaryrefslogtreecommitdiff
path: root/lib/Object
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Object')
-rw-r--r--lib/Object/COFFObjectFile.cpp16
-rw-r--r--lib/Object/MachOObjectFile.cpp28
-rw-r--r--lib/Object/Object.cpp12
3 files changed, 28 insertions, 28 deletions
diff --git a/lib/Object/COFFObjectFile.cpp b/lib/Object/COFFObjectFile.cpp
index a604acda74..a1bbc56d2b 100644
--- a/lib/Object/COFFObjectFile.cpp
+++ b/lib/Object/COFFObjectFile.cpp
@@ -205,7 +205,7 @@ error_code COFFObjectFile::getSymbolSection(DataRefImpl Ref,
section_iterator &Result) const {
const coff_symbol *Symb = toSymb(Ref);
if (Symb->SectionNumber <= COFF::IMAGE_SYM_UNDEFINED)
- Result = end_sections();
+ Result = section_end();
else {
const coff_section *Sec = 0;
if (error_code EC = getSection(Symb->SectionNumber, Sec)) return EC;
@@ -383,7 +383,7 @@ error_code COFFObjectFile::initSymbolTablePtr() {
// Returns the file offset for the given RVA.
error_code COFFObjectFile::getRvaPtr(uint32_t Rva, uintptr_t &Res) const {
- for (section_iterator I = begin_sections(), E = end_sections(); I != E;
+ for (section_iterator I = section_begin(), E = section_end(); I != E;
++I) {
const coff_section *Section = getCOFFSection(I);
uint32_t SectionStart = Section->VirtualAddress;
@@ -540,25 +540,25 @@ COFFObjectFile::COFFObjectFile(MemoryBuffer *Object, error_code &EC,
EC = object_error::success;
}
-symbol_iterator COFFObjectFile::begin_symbols() const {
+symbol_iterator COFFObjectFile::symbol_begin() const {
DataRefImpl Ret;
Ret.p = reinterpret_cast<uintptr_t>(SymbolTable);
return symbol_iterator(SymbolRef(Ret, this));
}
-symbol_iterator COFFObjectFile::end_symbols() const {
+symbol_iterator COFFObjectFile::symbol_end() const {
// The symbol table ends where the string table begins.
DataRefImpl Ret;
Ret.p = reinterpret_cast<uintptr_t>(StringTable);
return symbol_iterator(SymbolRef(Ret, this));
}
-library_iterator COFFObjectFile::begin_libraries_needed() const {
+library_iterator COFFObjectFile::needed_library_begin() const {
// TODO: implement
report_fatal_error("Libraries needed unimplemented in COFFObjectFile");
}
-library_iterator COFFObjectFile::end_libraries_needed() const {
+library_iterator COFFObjectFile::needed_library_end() const {
// TODO: implement
report_fatal_error("Libraries needed unimplemented in COFFObjectFile");
}
@@ -591,13 +591,13 @@ export_directory_iterator COFFObjectFile::export_directory_end() const {
return export_directory_iterator(Ref);
}
-section_iterator COFFObjectFile::begin_sections() const {
+section_iterator COFFObjectFile::section_begin() const {
DataRefImpl Ret;
Ret.p = reinterpret_cast<uintptr_t>(SectionTable);
return section_iterator(SectionRef(Ret, this));
}
-section_iterator COFFObjectFile::end_sections() const {
+section_iterator COFFObjectFile::section_end() const {
DataRefImpl Ret;
int NumSections = COFFHeader->isImportLibrary()
? 0 : COFFHeader->NumberOfSections;
diff --git a/lib/Object/MachOObjectFile.cpp b/lib/Object/MachOObjectFile.cpp
index 3dd837c6e7..23c2d6d8bd 100644
--- a/lib/Object/MachOObjectFile.cpp
+++ b/lib/Object/MachOObjectFile.cpp
@@ -296,7 +296,7 @@ static void printRelocationTargetName(const MachOObjectFile *O,
if (IsScattered) {
uint32_t Val = O->getPlainRelocationSymbolNum(RE);
- 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) {
error_code ec;
uint64_t Addr;
@@ -313,7 +313,7 @@ static void printRelocationTargetName(const MachOObjectFile *O,
// If we couldn't find a symbol that this relocation refers to, try
// to find a section beginning instead.
- 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) {
error_code ec;
uint64_t Addr;
@@ -337,11 +337,11 @@ static void printRelocationTargetName(const MachOObjectFile *O,
uint64_t Val = O->getPlainRelocationSymbolNum(RE);
if (isExtern) {
- symbol_iterator SI = O->begin_symbols();
+ symbol_iterator SI = O->symbol_begin();
advance(SI, Val);
SI->getName(S);
} else {
- section_iterator SI = O->begin_sections();
+ section_iterator SI = O->section_begin();
// Adjust for the fact that sections are 1-indexed.
advance(SI, Val - 1);
SI->getName(S);
@@ -528,7 +528,7 @@ error_code MachOObjectFile::getSymbolSize(DataRefImpl DRI,
}
// Unfortunately symbols are unsorted so we need to touch all
// symbols from load command
- for (symbol_iterator I = begin_symbols(), E = end_symbols(); I != E; ++I) {
+ for (symbol_iterator I = symbol_begin(), E = symbol_end(); I != E; ++I) {
DataRefImpl DRI = I->getRawDataRefImpl();
Entry = getSymbolTableEntryBase(this, DRI);
getSymbolAddress(DRI, Value);
@@ -612,7 +612,7 @@ MachOObjectFile::getSymbolSection(DataRefImpl Symb,
uint8_t index = Entry.n_sect;
if (index == 0) {
- Res = end_sections();
+ Res = section_end();
} else {
DataRefImpl DRI;
DRI.d.a = index - 1;
@@ -834,7 +834,7 @@ MachOObjectFile::getRelocationSymbol(DataRefImpl Rel) const {
uint32_t SymbolIdx = getPlainRelocationSymbolNum(RE);
bool isExtern = getPlainRelocationExternal(RE);
if (!isExtern)
- return end_symbols();
+ return symbol_end();
MachO::symtab_command S = getSymtabLoadCommand();
unsigned SymbolTableEntrySize = is64Bit() ?
@@ -1163,7 +1163,7 @@ error_code MachOObjectFile::getLibraryPath(DataRefImpl LibData,
report_fatal_error("Needed libraries unimplemented in MachOObjectFile");
}
-symbol_iterator MachOObjectFile::begin_symbols() const {
+symbol_iterator MachOObjectFile::symbol_begin() const {
DataRefImpl DRI;
if (!SymtabLoadCmd)
return symbol_iterator(SymbolRef(DRI, this));
@@ -1173,7 +1173,7 @@ symbol_iterator MachOObjectFile::begin_symbols() const {
return symbol_iterator(SymbolRef(DRI, this));
}
-symbol_iterator MachOObjectFile::end_symbols() const {
+symbol_iterator MachOObjectFile::symbol_end() const {
DataRefImpl DRI;
if (!SymtabLoadCmd)
return symbol_iterator(SymbolRef(DRI, this));
@@ -1188,23 +1188,23 @@ symbol_iterator MachOObjectFile::end_symbols() const {
return symbol_iterator(SymbolRef(DRI, this));
}
-section_iterator MachOObjectFile::begin_sections() const {
+section_iterator MachOObjectFile::section_begin() const {
DataRefImpl DRI;
return section_iterator(SectionRef(DRI, this));
}
-section_iterator MachOObjectFile::end_sections() const {
+section_iterator MachOObjectFile::section_end() const {
DataRefImpl DRI;
DRI.d.a = Sections.size();
return section_iterator(SectionRef(DRI, this));
}
-library_iterator MachOObjectFile::begin_libraries_needed() const {
+library_iterator MachOObjectFile::needed_library_begin() const {
// TODO: implement
report_fatal_error("Needed libraries unimplemented in MachOObjectFile");
}
-library_iterator MachOObjectFile::end_libraries_needed() const {
+library_iterator MachOObjectFile::needed_library_end() const {
// TODO: implement
report_fatal_error("Needed libraries unimplemented in MachOObjectFile");
}
@@ -1389,7 +1389,7 @@ SectionRef
MachOObjectFile::getRelocationSection(
const MachO::any_relocation_info &RE) const {
if (isRelocationScattered(RE) || getPlainRelocationExternal(RE))
- return *end_sections();
+ return *section_end();
unsigned SecNum = getPlainRelocationSymbolNum(RE) - 1;
DataRefImpl DRI;
DRI.d.a = SecNum;
diff --git a/lib/Object/Object.cpp b/lib/Object/Object.cpp
index 399d460f8c..243bd44a02 100644
--- a/lib/Object/Object.cpp
+++ b/lib/Object/Object.cpp
@@ -70,7 +70,7 @@ void LLVMDisposeObjectFile(LLVMObjectFileRef ObjectFile) {
// ObjectFile Section iterators
LLVMSectionIteratorRef LLVMGetSections(LLVMObjectFileRef ObjectFile) {
- section_iterator SI = unwrap(ObjectFile)->begin_sections();
+ section_iterator SI = unwrap(ObjectFile)->section_begin();
return wrap(new section_iterator(SI));
}
@@ -80,7 +80,7 @@ void LLVMDisposeSectionIterator(LLVMSectionIteratorRef SI) {
LLVMBool LLVMIsSectionIteratorAtEnd(LLVMObjectFileRef ObjectFile,
LLVMSectionIteratorRef SI) {
- return (*unwrap(SI) == unwrap(ObjectFile)->end_sections()) ? 1 : 0;
+ return (*unwrap(SI) == unwrap(ObjectFile)->section_end()) ? 1 : 0;
}
void LLVMMoveToNextSection(LLVMSectionIteratorRef SI) {
@@ -95,7 +95,7 @@ void LLVMMoveToContainingSection(LLVMSectionIteratorRef Sect,
// ObjectFile Symbol iterators
LLVMSymbolIteratorRef LLVMGetSymbols(LLVMObjectFileRef ObjectFile) {
- symbol_iterator SI = unwrap(ObjectFile)->begin_symbols();
+ symbol_iterator SI = unwrap(ObjectFile)->symbol_begin();
return wrap(new symbol_iterator(SI));
}
@@ -105,7 +105,7 @@ void LLVMDisposeSymbolIterator(LLVMSymbolIteratorRef SI) {
LLVMBool LLVMIsSymbolIteratorAtEnd(LLVMObjectFileRef ObjectFile,
LLVMSymbolIteratorRef SI) {
- return (*unwrap(SI) == unwrap(ObjectFile)->end_symbols()) ? 1 : 0;
+ return (*unwrap(SI) == unwrap(ObjectFile)->symbol_end()) ? 1 : 0;
}
void LLVMMoveToNextSymbol(LLVMSymbolIteratorRef SI) {
@@ -151,7 +151,7 @@ LLVMBool LLVMGetSectionContainsSymbol(LLVMSectionIteratorRef SI,
// Section Relocation iterators
LLVMRelocationIteratorRef LLVMGetRelocations(LLVMSectionIteratorRef Section) {
- relocation_iterator SI = (*unwrap(Section))->begin_relocations();
+ relocation_iterator SI = (*unwrap(Section))->relocation_begin();
return wrap(new relocation_iterator(SI));
}
@@ -161,7 +161,7 @@ void LLVMDisposeRelocationIterator(LLVMRelocationIteratorRef SI) {
LLVMBool LLVMIsRelocationIteratorAtEnd(LLVMSectionIteratorRef Section,
LLVMRelocationIteratorRef SI) {
- return (*unwrap(SI) == (*unwrap(Section))->end_relocations()) ? 1 : 0;
+ return (*unwrap(SI) == (*unwrap(Section))->relocation_end()) ? 1 : 0;
}
void LLVMMoveToNextRelocation(LLVMRelocationIteratorRef SI) {