mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-21 18:29:46 +00:00
Add a symbols() range and use a range loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211222 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d8fc64e0d1
commit
6c59006684
@ -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
Block a user