MC: Change MCAssembler::Symbols to store MCSymbol, NFC

Instead of storing a list of the `MCSymbolData` in use, store the
`MCSymbol`s.  Churning in the direction of removing the back pointer
from `MCSymbolData`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237496 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-05-16 00:35:24 +00:00
parent ddf553bb8d
commit a5bb842d95
5 changed files with 17 additions and 18 deletions

View File

@ -548,8 +548,7 @@ void MachObjectWriter::ComputeSymbolTable(
assert(Index <= 256 && "Too many sections!");
// Build the string table.
for (MCSymbolData &SD : Asm.symbols()) {
const MCSymbol &Symbol = SD.getSymbol();
for (const MCSymbol &Symbol : Asm.symbols()) {
if (!Asm.isSymbolLinkerVisible(Symbol))
continue;
@ -562,8 +561,8 @@ void MachObjectWriter::ComputeSymbolTable(
// The particular order that we collect and 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 (MCSymbolData &SD : Asm.symbols()) {
const MCSymbol &Symbol = SD.getSymbol();
for (const MCSymbol &Symbol : Asm.symbols()) {
MCSymbolData &SD = Symbol.getData();
// Ignore non-linker visible symbols.
if (!Asm.isSymbolLinkerVisible(Symbol))
@ -590,8 +589,8 @@ void MachObjectWriter::ComputeSymbolTable(
}
// Now add the data for local symbols.
for (MCSymbolData &SD : Asm.symbols()) {
const MCSymbol &Symbol = SD.getSymbol();
for (const MCSymbol &Symbol : Asm.symbols()) {
MCSymbolData &SD = Symbol.getData();
// Ignore non-linker visible symbols.
if (!Asm.isSymbolLinkerVisible(Symbol))