forked from OSchip/llvm-project
Add a symbols() range and use a range loop.
llvm-svn: 211222
This commit is contained in:
parent
794112a91f
commit
1fe2c5ab27
|
@ -136,6 +136,10 @@ public:
|
|||
basic_symbol_iterator symbol_end() const {
|
||||
return symbol_end_impl();
|
||||
}
|
||||
typedef iterator_range<basic_symbol_iterator> basic_symbol_iterator_range;
|
||||
basic_symbol_iterator_range symbols() const {
|
||||
return basic_symbol_iterator_range(symbol_begin(), symbol_end());
|
||||
}
|
||||
|
||||
// construction aux.
|
||||
static ErrorOr<SymbolicFile *> createIRObjectFile(MemoryBuffer *Object,
|
||||
|
|
|
@ -710,17 +710,15 @@ static void writeSymbolTable(
|
|||
print32BE(Out, 0);
|
||||
}
|
||||
|
||||
for (object::basic_symbol_iterator I = Obj->symbol_begin(),
|
||||
E = Obj->symbol_end();
|
||||
I != E; ++I) {
|
||||
uint32_t Symflags = I->getFlags();
|
||||
for (const object::BasicSymbolRef &S : Obj->symbols()) {
|
||||
uint32_t Symflags = S.getFlags();
|
||||
if (Symflags & object::SymbolRef::SF_FormatSpecific)
|
||||
continue;
|
||||
if (!(Symflags & object::SymbolRef::SF_Global))
|
||||
continue;
|
||||
if (Symflags & object::SymbolRef::SF_Undefined)
|
||||
continue;
|
||||
failIfError(I->printName(NameOS));
|
||||
failIfError(S.printName(NameOS));
|
||||
NameOS << '\0';
|
||||
++NumSyms;
|
||||
MemberOffsetRefs.push_back(std::make_pair(Out.tell(), MemberNum));
|
||||
|
|
Loading…
Reference in New Issue