mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-28 07:17:32 +00:00
Add range access to MCAssembler's symbol collection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206631 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -516,15 +516,14 @@ ComputeSymbolTable(MCAssembler &Asm, SmallString<256> &StringTable,
|
||||
// table, then sort the symbols is chosen to match 'as'. Even though it
|
||||
// doesn't matter for correctness, this is important for letting us diff .o
|
||||
// files.
|
||||
for (MCAssembler::symbol_iterator it = Asm.symbol_begin(),
|
||||
ie = Asm.symbol_end(); it != ie; ++it) {
|
||||
const MCSymbol &Symbol = it->getSymbol();
|
||||
for (MCSymbolData &SD : Asm.symbols()) {
|
||||
const MCSymbol &Symbol = SD.getSymbol();
|
||||
|
||||
// Ignore non-linker visible symbols.
|
||||
if (!Asm.isSymbolLinkerVisible(it->getSymbol()))
|
||||
if (!Asm.isSymbolLinkerVisible(SD.getSymbol()))
|
||||
continue;
|
||||
|
||||
if (!it->isExternal() && !Symbol.isUndefined())
|
||||
if (!SD.isExternal() && !Symbol.isUndefined())
|
||||
continue;
|
||||
|
||||
uint64_t &Entry = StringIndexMap[Symbol.getName()];
|
||||
@@ -535,7 +534,7 @@ ComputeSymbolTable(MCAssembler &Asm, SmallString<256> &StringTable,
|
||||
}
|
||||
|
||||
MachSymbolData MSD;
|
||||
MSD.SymbolData = it;
|
||||
MSD.SymbolData = &SD;
|
||||
MSD.StringIndex = Entry;
|
||||
|
||||
if (Symbol.isUndefined()) {
|
||||
@@ -552,15 +551,14 @@ ComputeSymbolTable(MCAssembler &Asm, SmallString<256> &StringTable,
|
||||
}
|
||||
|
||||
// Now add the data for local symbols.
|
||||
for (MCAssembler::symbol_iterator it = Asm.symbol_begin(),
|
||||
ie = Asm.symbol_end(); it != ie; ++it) {
|
||||
const MCSymbol &Symbol = it->getSymbol();
|
||||
for (MCSymbolData &SD : Asm.symbols()) {
|
||||
const MCSymbol &Symbol = SD.getSymbol();
|
||||
|
||||
// Ignore non-linker visible symbols.
|
||||
if (!Asm.isSymbolLinkerVisible(it->getSymbol()))
|
||||
if (!Asm.isSymbolLinkerVisible(SD.getSymbol()))
|
||||
continue;
|
||||
|
||||
if (it->isExternal() || Symbol.isUndefined())
|
||||
if (SD.isExternal() || Symbol.isUndefined())
|
||||
continue;
|
||||
|
||||
uint64_t &Entry = StringIndexMap[Symbol.getName()];
|
||||
@@ -571,7 +569,7 @@ ComputeSymbolTable(MCAssembler &Asm, SmallString<256> &StringTable,
|
||||
}
|
||||
|
||||
MachSymbolData MSD;
|
||||
MSD.SymbolData = it;
|
||||
MSD.SymbolData = &SD;
|
||||
MSD.StringIndex = Entry;
|
||||
|
||||
if (Symbol.isAbsolute()) {
|
||||
@@ -621,10 +619,7 @@ void MachObjectWriter::computeSectionAddresses(const MCAssembler &Asm,
|
||||
|
||||
void MachObjectWriter::markAbsoluteVariableSymbols(MCAssembler &Asm,
|
||||
const MCAsmLayout &Layout) {
|
||||
for (MCAssembler::symbol_iterator i = Asm.symbol_begin(),
|
||||
e = Asm.symbol_end();
|
||||
i != e; ++i) {
|
||||
MCSymbolData &SD = *i;
|
||||
for (MCSymbolData &SD : Asm.symbols()) {
|
||||
if (!SD.getSymbol().isVariable())
|
||||
continue;
|
||||
|
||||
|
Reference in New Issue
Block a user