[llvm] r199751 - Rename these methods to match the style guide.
Rafael Espindola
rafael.espindola at gmail.com
Tue Jan 21 08:09:46 PST 2014
Author: rafael
Date: Tue Jan 21 10:09:45 2014
New Revision: 199751
URL: http://llvm.org/viewvc/llvm-project?rev=199751&view=rev
Log:
Rename these methods to match the style guide.
Modified:
llvm/trunk/include/llvm/Object/Archive.h
llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp
llvm/trunk/lib/Object/Archive.cpp
llvm/trunk/tools/llvm-ar/llvm-ar.cpp
llvm/trunk/tools/llvm-nm/llvm-nm.cpp
llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp
llvm/trunk/tools/llvm-size/llvm-size.cpp
Modified: llvm/trunk/include/llvm/Object/Archive.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/Archive.h?rev=199751&r1=199750&r2=199751&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/Archive.h (original)
+++ llvm/trunk/include/llvm/Object/Archive.h Tue Jan 21 10:09:45 2014
@@ -174,11 +174,11 @@ public:
return Format;
}
- child_iterator begin_children(bool SkipInternal = true) const;
- child_iterator end_children() const;
+ child_iterator child_begin(bool SkipInternal = true) const;
+ child_iterator child_end() const;
- symbol_iterator begin_symbols() const;
- symbol_iterator end_symbols() const;
+ symbol_iterator symbol_begin() const;
+ symbol_iterator symbol_end() const;
// Cast methods.
static inline bool classof(Binary const *v) {
Modified: llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp?rev=199751&r1=199750&r2=199751&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp Tue Jan 21 10:09:45 2014
@@ -301,7 +301,7 @@ uint64_t MCJIT::getSymbolAddress(const s
object::Archive *A = *I;
// Look for our symbols in each Archive
object::Archive::child_iterator ChildIt = A->findSym(Name);
- if (ChildIt != A->end_children()) {
+ if (ChildIt != A->child_end()) {
OwningPtr<object::Binary> ChildBin;
// FIXME: Support nested archives?
if (!ChildIt->getAsBinary(ChildBin) && ChildBin->isObject()) {
Modified: llvm/trunk/lib/Object/Archive.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/Archive.cpp?rev=199751&r1=199750&r2=199751&view=diff
==============================================================================
--- llvm/trunk/lib/Object/Archive.cpp (original)
+++ llvm/trunk/lib/Object/Archive.cpp Tue Jan 21 10:09:45 2014
@@ -136,7 +136,7 @@ error_code Archive::Child::getName(Strin
+ sizeof(ArchiveMemberHeader)
+ offset;
// Verify it.
- if (Parent->StringTable == Parent->end_children()
+ if (Parent->StringTable == Parent->child_end()
|| addr < (Parent->StringTable->Data.begin()
+ sizeof(ArchiveMemberHeader))
|| addr > (Parent->StringTable->Data.begin()
@@ -195,7 +195,7 @@ error_code Archive::Child::getAsBinary(O
}
Archive::Archive(MemoryBuffer *source, error_code &ec)
- : Binary(Binary::ID_Archive, source), SymbolTable(end_children()) {
+ : Binary(Binary::ID_Archive, source), SymbolTable(child_end()) {
// Check for sufficient magic.
assert(source);
if (source->getBufferSize() < 8 ||
@@ -205,8 +205,8 @@ Archive::Archive(MemoryBuffer *source, e
}
// Get the special members.
- child_iterator i = begin_children(false);
- child_iterator e = end_children();
+ child_iterator i = child_begin(false);
+ child_iterator e = child_end();
if (i == e) {
ec = object_error::success;
@@ -310,9 +310,9 @@ Archive::Archive(MemoryBuffer *source, e
ec = object_error::success;
}
-Archive::child_iterator Archive::begin_children(bool SkipInternal) const {
+Archive::child_iterator Archive::child_begin(bool SkipInternal) const {
if (Data->getBufferSize() == 8) // empty archive.
- return end_children();
+ return child_end();
if (SkipInternal)
return FirstRegular;
@@ -322,7 +322,7 @@ Archive::child_iterator Archive::begin_c
return c;
}
-Archive::child_iterator Archive::end_children() const {
+Archive::child_iterator Archive::child_end() const {
return Child(this, NULL);
}
@@ -385,7 +385,7 @@ Archive::Symbol Archive::Symbol::getNext
return t;
}
-Archive::symbol_iterator Archive::begin_symbols() const {
+Archive::symbol_iterator Archive::symbol_begin() const {
if (!hasSymbolTable())
return symbol_iterator(Symbol(this, 0, 0));
@@ -408,7 +408,7 @@ Archive::symbol_iterator Archive::begin_
return symbol_iterator(Symbol(this, 0, string_start_offset));
}
-Archive::symbol_iterator Archive::end_symbols() const {
+Archive::symbol_iterator Archive::symbol_end() const {
if (!hasSymbolTable())
return symbol_iterator(Symbol(this, 0, 0));
@@ -429,23 +429,23 @@ Archive::symbol_iterator Archive::end_sy
}
Archive::child_iterator Archive::findSym(StringRef name) const {
- Archive::symbol_iterator bs = begin_symbols();
- Archive::symbol_iterator es = end_symbols();
+ Archive::symbol_iterator bs = symbol_begin();
+ Archive::symbol_iterator es = symbol_end();
Archive::child_iterator result;
StringRef symname;
for (; bs != es; ++bs) {
if (bs->getName(symname))
- return end_children();
+ return child_end();
if (symname == name) {
if (bs->getMember(result))
- return end_children();
+ return child_end();
return result;
}
}
- return end_children();
+ return child_end();
}
bool Archive::hasSymbolTable() const {
- return SymbolTable != end_children();
+ return SymbolTable != child_end();
}
Modified: llvm/trunk/tools/llvm-ar/llvm-ar.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ar/llvm-ar.cpp?rev=199751&r1=199750&r2=199751&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-ar/llvm-ar.cpp (original)
+++ llvm/trunk/tools/llvm-ar/llvm-ar.cpp Tue Jan 21 10:09:45 2014
@@ -365,8 +365,8 @@ static bool shouldCreateArchive(ArchiveO
static void performReadOperation(ArchiveOperation Operation,
object::Archive *OldArchive) {
- for (object::Archive::child_iterator I = OldArchive->begin_children(),
- E = OldArchive->end_children();
+ for (object::Archive::child_iterator I = OldArchive->child_begin(),
+ E = OldArchive->child_end();
I != E; ++I) {
StringRef Name;
failIfError(I->getName(Name));
@@ -516,8 +516,8 @@ computeNewArchiveMembers(ArchiveOperatio
int InsertPos = -1;
StringRef PosName = sys::path::filename(RelPos);
if (OldArchive) {
- for (object::Archive::child_iterator I = OldArchive->begin_children(),
- E = OldArchive->end_children();
+ for (object::Archive::child_iterator I = OldArchive->child_begin(),
+ E = OldArchive->child_end();
I != E; ++I) {
int Pos = Ret.size();
StringRef Name;
Modified: llvm/trunk/tools/llvm-nm/llvm-nm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-nm/llvm-nm.cpp?rev=199751&r1=199750&r2=199751&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-nm/llvm-nm.cpp (original)
+++ llvm/trunk/tools/llvm-nm/llvm-nm.cpp Tue Jan 21 10:09:45 2014
@@ -587,8 +587,8 @@ static void DumpSymbolNamesFromFile(std:
if (object::Archive *a = dyn_cast<object::Archive>(arch.get())) {
if (ArchiveMap) {
- object::Archive::symbol_iterator I = a->begin_symbols();
- object::Archive::symbol_iterator E = a->end_symbols();
+ object::Archive::symbol_iterator I = a->symbol_begin();
+ object::Archive::symbol_iterator E = a->symbol_end();
if (I !=E) {
outs() << "Archive map" << "\n";
for (; I != E; ++I) {
@@ -607,8 +607,8 @@ static void DumpSymbolNamesFromFile(std:
}
}
- for (object::Archive::child_iterator i = a->begin_children(),
- e = a->end_children(); i != e; ++i) {
+ for (object::Archive::child_iterator i = a->child_begin(),
+ e = a->child_end(); i != e; ++i) {
OwningPtr<Binary> child;
if (i->getAsBinary(child)) {
// Try opening it as a bitcode file.
Modified: llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp?rev=199751&r1=199750&r2=199751&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp Tue Jan 21 10:09:45 2014
@@ -801,8 +801,8 @@ static void DumpObject(const ObjectFile
/// @brief Dump each object file in \a a;
static void DumpArchive(const Archive *a) {
- for (Archive::child_iterator i = a->begin_children(),
- e = a->end_children(); i != e; ++i) {
+ for (Archive::child_iterator i = a->child_begin(),
+ e = a->child_end(); i != e; ++i) {
OwningPtr<Binary> child;
if (error_code ec = i->getAsBinary(child)) {
// Ignore non-object files.
Modified: llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp?rev=199751&r1=199750&r2=199751&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp Tue Jan 21 10:09:45 2014
@@ -232,8 +232,8 @@ static void dumpObject(const ObjectFile
/// @brief Dumps each object file in \a Arc;
static void dumpArchive(const Archive *Arc) {
- for (Archive::child_iterator ArcI = Arc->begin_children(),
- ArcE = Arc->end_children();
+ for (Archive::child_iterator ArcI = Arc->child_begin(),
+ ArcE = Arc->child_end();
ArcI != ArcE; ++ArcI) {
OwningPtr<Binary> child;
if (error_code EC = ArcI->getAsBinary(child)) {
Modified: llvm/trunk/tools/llvm-size/llvm-size.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-size/llvm-size.cpp?rev=199751&r1=199750&r2=199751&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-size/llvm-size.cpp (original)
+++ llvm/trunk/tools/llvm-size/llvm-size.cpp Tue Jan 21 10:09:45 2014
@@ -253,8 +253,8 @@ static void PrintFileSectionSizes(String
if (Archive *a = dyn_cast<Archive>(binary.get())) {
// This is an archive. Iterate over each member and display its sizes.
- for (object::Archive::child_iterator i = a->begin_children(),
- e = a->end_children(); i != e; ++i) {
+ for (object::Archive::child_iterator i = a->child_begin(),
+ e = a->child_end(); i != e; ++i) {
OwningPtr<Binary> child;
if (error_code ec = i->getAsBinary(child)) {
errs() << ToolName << ": " << file << ": " << ec.message() << ".\n";
More information about the llvm-commits
mailing list