llvm.org GIT mirror llvm / 94ad5a1
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 Rafael Espindola 6 years ago
8 changed file(s) with 36 addition(s) and 36 deletion(s). Raw diff Collapse all Expand all
173173 return Format;
174174 }
175175
176 child_iterator begin_children(bool SkipInternal = true) const;
177 child_iterator end_children() const;
178
179 symbol_iterator begin_symbols() const;
180 symbol_iterator end_symbols() const;
176 child_iterator child_begin(bool SkipInternal = true) const;
177 child_iterator child_end() const;
178
179 symbol_iterator symbol_begin() const;
180 symbol_iterator symbol_end() const;
181181
182182 // Cast methods.
183183 static inline bool classof(Binary const *v) {
300300 object::Archive *A = *I;
301301 // Look for our symbols in each Archive
302302 object::Archive::child_iterator ChildIt = A->findSym(Name);
303 if (ChildIt != A->end_children()) {
303 if (ChildIt != A->child_end()) {
304304 OwningPtr ChildBin;
305305 // FIXME: Support nested archives?
306306 if (!ChildIt->getAsBinary(ChildBin) && ChildBin->isObject()) {
135135 + sizeof(ArchiveMemberHeader)
136136 + offset;
137137 // Verify it.
138 if (Parent->StringTable == Parent->end_children()
138 if (Parent->StringTable == Parent->child_end()
139139 || addr < (Parent->StringTable->Data.begin()
140140 + sizeof(ArchiveMemberHeader))
141141 || addr > (Parent->StringTable->Data.begin()
194194 }
195195
196196 Archive::Archive(MemoryBuffer *source, error_code &ec)
197 : Binary(Binary::ID_Archive, source), SymbolTable(end_children()) {
197 : Binary(Binary::ID_Archive, source), SymbolTable(child_end()) {
198198 // Check for sufficient magic.
199199 assert(source);
200200 if (source->getBufferSize() < 8 ||
204204 }
205205
206206 // Get the special members.
207 child_iterator i = begin_children(false);
208 child_iterator e = end_children();
207 child_iterator i = child_begin(false);
208 child_iterator e = child_end();
209209
210210 if (i == e) {
211211 ec = object_error::success;
309309 ec = object_error::success;
310310 }
311311
312 Archive::child_iterator Archive::begin_children(bool SkipInternal) const {
312 Archive::child_iterator Archive::child_begin(bool SkipInternal) const {
313313 if (Data->getBufferSize() == 8) // empty archive.
314 return end_children();
314 return child_end();
315315
316316 if (SkipInternal)
317317 return FirstRegular;
321321 return c;
322322 }
323323
324 Archive::child_iterator Archive::end_children() const {
324 Archive::child_iterator Archive::child_end() const {
325325 return Child(this, NULL);
326326 }
327327
384384 return t;
385385 }
386386
387 Archive::symbol_iterator Archive::begin_symbols() const {
387 Archive::symbol_iterator Archive::symbol_begin() const {
388388 if (!hasSymbolTable())
389389 return symbol_iterator(Symbol(this, 0, 0));
390390
407407 return symbol_iterator(Symbol(this, 0, string_start_offset));
408408 }
409409
410 Archive::symbol_iterator Archive::end_symbols() const {
410 Archive::symbol_iterator Archive::symbol_end() const {
411411 if (!hasSymbolTable())
412412 return symbol_iterator(Symbol(this, 0, 0));
413413
428428 }
429429
430430 Archive::child_iterator Archive::findSym(StringRef name) const {
431 Archive::symbol_iterator bs = begin_symbols();
432 Archive::symbol_iterator es = end_symbols();
431 Archive::symbol_iterator bs = symbol_begin();
432 Archive::symbol_iterator es = symbol_end();
433433 Archive::child_iterator result;
434434
435435 StringRef symname;
436436 for (; bs != es; ++bs) {
437437 if (bs->getName(symname))
438 return end_children();
438 return child_end();
439439 if (symname == name) {
440440 if (bs->getMember(result))
441 return end_children();
441 return child_end();
442442 return result;
443443 }
444444 }
445 return end_children();
445 return child_end();
446446 }
447447
448448 bool Archive::hasSymbolTable() const {
449 return SymbolTable != end_children();
450 }
449 return SymbolTable != child_end();
450 }
364364
365365 static void performReadOperation(ArchiveOperation Operation,
366366 object::Archive *OldArchive) {
367 for (object::Archive::child_iterator I = OldArchive->begin_children(),
368 E = OldArchive->end_children();
367 for (object::Archive::child_iterator I = OldArchive->child_begin(),
368 E = OldArchive->child_end();
369369 I != E; ++I) {
370370 StringRef Name;
371371 failIfError(I->getName(Name));
515515 int InsertPos = -1;
516516 StringRef PosName = sys::path::filename(RelPos);
517517 if (OldArchive) {
518 for (object::Archive::child_iterator I = OldArchive->begin_children(),
519 E = OldArchive->end_children();
518 for (object::Archive::child_iterator I = OldArchive->child_begin(),
519 E = OldArchive->child_end();
520520 I != E; ++I) {
521521 int Pos = Ret.size();
522522 StringRef Name;
586586
587587 if (object::Archive *a = dyn_cast(arch.get())) {
588588 if (ArchiveMap) {
589 object::Archive::symbol_iterator I = a->begin_symbols();
590 object::Archive::symbol_iterator E = a->end_symbols();
589 object::Archive::symbol_iterator I = a->symbol_begin();
590 object::Archive::symbol_iterator E = a->symbol_end();
591591 if (I !=E) {
592592 outs() << "Archive map" << "\n";
593593 for (; I != E; ++I) {
606606 }
607607 }
608608
609 for (object::Archive::child_iterator i = a->begin_children(),
610 e = a->end_children(); i != e; ++i) {
609 for (object::Archive::child_iterator i = a->child_begin(),
610 e = a->child_end(); i != e; ++i) {
611611 OwningPtr child;
612612 if (i->getAsBinary(child)) {
613613 // Try opening it as a bitcode file.
800800
801801 /// @brief Dump each object file in \a a;
802802 static void DumpArchive(const Archive *a) {
803 for (Archive::child_iterator i = a->begin_children(),
804 e = a->end_children(); i != e; ++i) {
803 for (Archive::child_iterator i = a->child_begin(),
804 e = a->child_end(); i != e; ++i) {
805805 OwningPtr child;
806806 if (error_code ec = i->getAsBinary(child)) {
807807 // Ignore non-object files.
231231
232232 /// @brief Dumps each object file in \a Arc;
233233 static void dumpArchive(const Archive *Arc) {
234 for (Archive::child_iterator ArcI = Arc->begin_children(),
235 ArcE = Arc->end_children();
234 for (Archive::child_iterator ArcI = Arc->child_begin(),
235 ArcE = Arc->child_end();
236236 ArcI != ArcE; ++ArcI) {
237237 OwningPtr child;
238238 if (error_code EC = ArcI->getAsBinary(child)) {
252252
253253 if (Archive *a = dyn_cast(binary.get())) {
254254 // This is an archive. Iterate over each member and display its sizes.
255 for (object::Archive::child_iterator i = a->begin_children(),
256 e = a->end_children(); i != e; ++i) {
255 for (object::Archive::child_iterator i = a->child_begin(),
256 e = a->child_end(); i != e; ++i) {
257257 OwningPtr child;
258258 if (error_code ec = i->getAsBinary(child)) {
259259 errs() << ToolName << ": " << file << ": " << ec.message() << ".\n";