mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
Rename these methods to match the style guide.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199751 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -174,11 +174,11 @@ public:
|
|||||||
return Format;
|
return Format;
|
||||||
}
|
}
|
||||||
|
|
||||||
child_iterator begin_children(bool SkipInternal = true) const;
|
child_iterator child_begin(bool SkipInternal = true) const;
|
||||||
child_iterator end_children() const;
|
child_iterator child_end() const;
|
||||||
|
|
||||||
symbol_iterator begin_symbols() const;
|
symbol_iterator symbol_begin() const;
|
||||||
symbol_iterator end_symbols() const;
|
symbol_iterator symbol_end() const;
|
||||||
|
|
||||||
// Cast methods.
|
// Cast methods.
|
||||||
static inline bool classof(Binary const *v) {
|
static inline bool classof(Binary const *v) {
|
||||||
|
@ -301,7 +301,7 @@ uint64_t MCJIT::getSymbolAddress(const std::string &Name,
|
|||||||
object::Archive *A = *I;
|
object::Archive *A = *I;
|
||||||
// Look for our symbols in each Archive
|
// Look for our symbols in each Archive
|
||||||
object::Archive::child_iterator ChildIt = A->findSym(Name);
|
object::Archive::child_iterator ChildIt = A->findSym(Name);
|
||||||
if (ChildIt != A->end_children()) {
|
if (ChildIt != A->child_end()) {
|
||||||
OwningPtr<object::Binary> ChildBin;
|
OwningPtr<object::Binary> ChildBin;
|
||||||
// FIXME: Support nested archives?
|
// FIXME: Support nested archives?
|
||||||
if (!ChildIt->getAsBinary(ChildBin) && ChildBin->isObject()) {
|
if (!ChildIt->getAsBinary(ChildBin) && ChildBin->isObject()) {
|
||||||
|
@ -136,7 +136,7 @@ error_code Archive::Child::getName(StringRef &Result) const {
|
|||||||
+ sizeof(ArchiveMemberHeader)
|
+ sizeof(ArchiveMemberHeader)
|
||||||
+ offset;
|
+ offset;
|
||||||
// Verify it.
|
// Verify it.
|
||||||
if (Parent->StringTable == Parent->end_children()
|
if (Parent->StringTable == Parent->child_end()
|
||||||
|| addr < (Parent->StringTable->Data.begin()
|
|| addr < (Parent->StringTable->Data.begin()
|
||||||
+ sizeof(ArchiveMemberHeader))
|
+ sizeof(ArchiveMemberHeader))
|
||||||
|| addr > (Parent->StringTable->Data.begin()
|
|| 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)
|
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.
|
// Check for sufficient magic.
|
||||||
assert(source);
|
assert(source);
|
||||||
if (source->getBufferSize() < 8 ||
|
if (source->getBufferSize() < 8 ||
|
||||||
@ -205,8 +205,8 @@ Archive::Archive(MemoryBuffer *source, error_code &ec)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the special members.
|
// Get the special members.
|
||||||
child_iterator i = begin_children(false);
|
child_iterator i = child_begin(false);
|
||||||
child_iterator e = end_children();
|
child_iterator e = child_end();
|
||||||
|
|
||||||
if (i == e) {
|
if (i == e) {
|
||||||
ec = object_error::success;
|
ec = object_error::success;
|
||||||
@ -310,9 +310,9 @@ Archive::Archive(MemoryBuffer *source, error_code &ec)
|
|||||||
ec = object_error::success;
|
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.
|
if (Data->getBufferSize() == 8) // empty archive.
|
||||||
return end_children();
|
return child_end();
|
||||||
|
|
||||||
if (SkipInternal)
|
if (SkipInternal)
|
||||||
return FirstRegular;
|
return FirstRegular;
|
||||||
@ -322,7 +322,7 @@ Archive::child_iterator Archive::begin_children(bool SkipInternal) const {
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
Archive::child_iterator Archive::end_children() const {
|
Archive::child_iterator Archive::child_end() const {
|
||||||
return Child(this, NULL);
|
return Child(this, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -385,7 +385,7 @@ Archive::Symbol Archive::Symbol::getNext() const {
|
|||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
Archive::symbol_iterator Archive::begin_symbols() const {
|
Archive::symbol_iterator Archive::symbol_begin() const {
|
||||||
if (!hasSymbolTable())
|
if (!hasSymbolTable())
|
||||||
return symbol_iterator(Symbol(this, 0, 0));
|
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));
|
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())
|
if (!hasSymbolTable())
|
||||||
return symbol_iterator(Symbol(this, 0, 0));
|
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::child_iterator Archive::findSym(StringRef name) const {
|
||||||
Archive::symbol_iterator bs = begin_symbols();
|
Archive::symbol_iterator bs = symbol_begin();
|
||||||
Archive::symbol_iterator es = end_symbols();
|
Archive::symbol_iterator es = symbol_end();
|
||||||
Archive::child_iterator result;
|
Archive::child_iterator result;
|
||||||
|
|
||||||
StringRef symname;
|
StringRef symname;
|
||||||
for (; bs != es; ++bs) {
|
for (; bs != es; ++bs) {
|
||||||
if (bs->getName(symname))
|
if (bs->getName(symname))
|
||||||
return end_children();
|
return child_end();
|
||||||
if (symname == name) {
|
if (symname == name) {
|
||||||
if (bs->getMember(result))
|
if (bs->getMember(result))
|
||||||
return end_children();
|
return child_end();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return end_children();
|
return child_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Archive::hasSymbolTable() const {
|
bool Archive::hasSymbolTable() const {
|
||||||
return SymbolTable != end_children();
|
return SymbolTable != child_end();
|
||||||
}
|
}
|
||||||
|
@ -365,8 +365,8 @@ static bool shouldCreateArchive(ArchiveOperation Op) {
|
|||||||
|
|
||||||
static void performReadOperation(ArchiveOperation Operation,
|
static void performReadOperation(ArchiveOperation Operation,
|
||||||
object::Archive *OldArchive) {
|
object::Archive *OldArchive) {
|
||||||
for (object::Archive::child_iterator I = OldArchive->begin_children(),
|
for (object::Archive::child_iterator I = OldArchive->child_begin(),
|
||||||
E = OldArchive->end_children();
|
E = OldArchive->child_end();
|
||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
StringRef Name;
|
StringRef Name;
|
||||||
failIfError(I->getName(Name));
|
failIfError(I->getName(Name));
|
||||||
@ -516,8 +516,8 @@ computeNewArchiveMembers(ArchiveOperation Operation,
|
|||||||
int InsertPos = -1;
|
int InsertPos = -1;
|
||||||
StringRef PosName = sys::path::filename(RelPos);
|
StringRef PosName = sys::path::filename(RelPos);
|
||||||
if (OldArchive) {
|
if (OldArchive) {
|
||||||
for (object::Archive::child_iterator I = OldArchive->begin_children(),
|
for (object::Archive::child_iterator I = OldArchive->child_begin(),
|
||||||
E = OldArchive->end_children();
|
E = OldArchive->child_end();
|
||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
int Pos = Ret.size();
|
int Pos = Ret.size();
|
||||||
StringRef Name;
|
StringRef Name;
|
||||||
|
@ -587,8 +587,8 @@ static void DumpSymbolNamesFromFile(std::string &Filename) {
|
|||||||
|
|
||||||
if (object::Archive *a = dyn_cast<object::Archive>(arch.get())) {
|
if (object::Archive *a = dyn_cast<object::Archive>(arch.get())) {
|
||||||
if (ArchiveMap) {
|
if (ArchiveMap) {
|
||||||
object::Archive::symbol_iterator I = a->begin_symbols();
|
object::Archive::symbol_iterator I = a->symbol_begin();
|
||||||
object::Archive::symbol_iterator E = a->end_symbols();
|
object::Archive::symbol_iterator E = a->symbol_end();
|
||||||
if (I !=E) {
|
if (I !=E) {
|
||||||
outs() << "Archive map" << "\n";
|
outs() << "Archive map" << "\n";
|
||||||
for (; I != E; ++I) {
|
for (; I != E; ++I) {
|
||||||
@ -607,8 +607,8 @@ static void DumpSymbolNamesFromFile(std::string &Filename) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (object::Archive::child_iterator i = a->begin_children(),
|
for (object::Archive::child_iterator i = a->child_begin(),
|
||||||
e = a->end_children(); i != e; ++i) {
|
e = a->child_end(); i != e; ++i) {
|
||||||
OwningPtr<Binary> child;
|
OwningPtr<Binary> child;
|
||||||
if (i->getAsBinary(child)) {
|
if (i->getAsBinary(child)) {
|
||||||
// Try opening it as a bitcode file.
|
// Try opening it as a bitcode file.
|
||||||
|
@ -801,8 +801,8 @@ static void DumpObject(const ObjectFile *o) {
|
|||||||
|
|
||||||
/// @brief Dump each object file in \a a;
|
/// @brief Dump each object file in \a a;
|
||||||
static void DumpArchive(const Archive *a) {
|
static void DumpArchive(const Archive *a) {
|
||||||
for (Archive::child_iterator i = a->begin_children(),
|
for (Archive::child_iterator i = a->child_begin(),
|
||||||
e = a->end_children(); i != e; ++i) {
|
e = a->child_end(); i != e; ++i) {
|
||||||
OwningPtr<Binary> child;
|
OwningPtr<Binary> child;
|
||||||
if (error_code ec = i->getAsBinary(child)) {
|
if (error_code ec = i->getAsBinary(child)) {
|
||||||
// Ignore non-object files.
|
// Ignore non-object files.
|
||||||
|
@ -232,8 +232,8 @@ static void dumpObject(const ObjectFile *Obj) {
|
|||||||
|
|
||||||
/// @brief Dumps each object file in \a Arc;
|
/// @brief Dumps each object file in \a Arc;
|
||||||
static void dumpArchive(const Archive *Arc) {
|
static void dumpArchive(const Archive *Arc) {
|
||||||
for (Archive::child_iterator ArcI = Arc->begin_children(),
|
for (Archive::child_iterator ArcI = Arc->child_begin(),
|
||||||
ArcE = Arc->end_children();
|
ArcE = Arc->child_end();
|
||||||
ArcI != ArcE; ++ArcI) {
|
ArcI != ArcE; ++ArcI) {
|
||||||
OwningPtr<Binary> child;
|
OwningPtr<Binary> child;
|
||||||
if (error_code EC = ArcI->getAsBinary(child)) {
|
if (error_code EC = ArcI->getAsBinary(child)) {
|
||||||
|
@ -253,8 +253,8 @@ static void PrintFileSectionSizes(StringRef file) {
|
|||||||
|
|
||||||
if (Archive *a = dyn_cast<Archive>(binary.get())) {
|
if (Archive *a = dyn_cast<Archive>(binary.get())) {
|
||||||
// This is an archive. Iterate over each member and display its sizes.
|
// This is an archive. Iterate over each member and display its sizes.
|
||||||
for (object::Archive::child_iterator i = a->begin_children(),
|
for (object::Archive::child_iterator i = a->child_begin(),
|
||||||
e = a->end_children(); i != e; ++i) {
|
e = a->child_end(); i != e; ++i) {
|
||||||
OwningPtr<Binary> child;
|
OwningPtr<Binary> child;
|
||||||
if (error_code ec = i->getAsBinary(child)) {
|
if (error_code ec = i->getAsBinary(child)) {
|
||||||
errs() << ToolName << ": " << file << ": " << ec.message() << ".\n";
|
errs() << ToolName << ": " << file << ": " << ec.message() << ".\n";
|
||||||
|
Reference in New Issue
Block a user