Rename these methods to match the style guide.

llvm-svn: 199751
This commit is contained in:
Rafael Espindola 2014-01-21 16:09:45 +00:00
parent 00cfc4bfac
commit 176488ad20
8 changed files with 34 additions and 34 deletions

View File

@ -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) {

View File

@ -301,7 +301,7 @@ uint64_t MCJIT::getSymbolAddress(const std::string &Name,
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()) {

View File

@ -136,7 +136,7 @@ error_code Archive::Child::getName(StringRef &Result) const {
+ 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(OwningPtr<Binary> &Result) const {
}
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, error_code &ec)
}
// 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, error_code &ec)
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_children(bool SkipInternal) const {
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() const {
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_symbols() const {
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_symbols() const {
}
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();
}

View File

@ -365,8 +365,8 @@ static bool shouldCreateArchive(ArchiveOperation Op) {
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(ArchiveOperation Operation,
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;

View File

@ -587,8 +587,8 @@ static void DumpSymbolNamesFromFile(std::string &Filename) {
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::string &Filename) {
}
}
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.

View File

@ -801,8 +801,8 @@ static void DumpObject(const ObjectFile *o) {
/// @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.

View File

@ -232,8 +232,8 @@ static void dumpObject(const ObjectFile *Obj) {
/// @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)) {

View File

@ -253,8 +253,8 @@ static void PrintFileSectionSizes(StringRef file) {
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";