mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Merge redundant loops. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238471 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2c7cce70cd
commit
86c0a109d8
@ -935,6 +935,11 @@ void ELFObjectWriter::computeSymbolTable(
|
|||||||
|
|
||||||
StrTabBuilder.finalize(StringTableBuilder::ELF);
|
StrTabBuilder.finalize(StringTableBuilder::ELF);
|
||||||
|
|
||||||
|
for (const std::string &Name : FileNames)
|
||||||
|
Writer.writeSymbol(StrTabBuilder.getOffset(Name),
|
||||||
|
ELF::STT_FILE | ELF::STB_LOCAL, 0, 0, ELF::STV_DEFAULT,
|
||||||
|
ELF::SHN_ABS, true);
|
||||||
|
|
||||||
// Symbols are required to be in lexicographic order.
|
// Symbols are required to be in lexicographic order.
|
||||||
array_pod_sort(LocalSymbolData.begin(), LocalSymbolData.end());
|
array_pod_sort(LocalSymbolData.begin(), LocalSymbolData.end());
|
||||||
array_pod_sort(ExternalSymbolData.begin(), ExternalSymbolData.end());
|
array_pod_sort(ExternalSymbolData.begin(), ExternalSymbolData.end());
|
||||||
@ -949,28 +954,15 @@ void ELFObjectWriter::computeSymbolTable(
|
|||||||
? 0
|
? 0
|
||||||
: StrTabBuilder.getOffset(MSD.Name);
|
: StrTabBuilder.getOffset(MSD.Name);
|
||||||
MSD.Symbol->setIndex(Index++);
|
MSD.Symbol->setIndex(Index++);
|
||||||
|
WriteSymbol(Writer, MSD, Layout);
|
||||||
}
|
}
|
||||||
for (ELFSymbolData &MSD : ExternalSymbolData) {
|
|
||||||
MSD.StringIndex = StrTabBuilder.getOffset(MSD.Name);
|
|
||||||
MSD.Symbol->setIndex(Index++);
|
|
||||||
}
|
|
||||||
for (ELFSymbolData &MSD : UndefinedSymbolData) {
|
|
||||||
MSD.StringIndex = StrTabBuilder.getOffset(MSD.Name);
|
|
||||||
MSD.Symbol->setIndex(Index++);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const std::string &Name : FileNames)
|
|
||||||
Writer.writeSymbol(StrTabBuilder.getOffset(Name),
|
|
||||||
ELF::STT_FILE | ELF::STB_LOCAL, 0, 0, ELF::STV_DEFAULT,
|
|
||||||
ELF::SHN_ABS, true);
|
|
||||||
|
|
||||||
// Write the symbol table entries.
|
// Write the symbol table entries.
|
||||||
LastLocalSymbolIndex = FileNames.size() + LocalSymbolData.size() + 1;
|
LastLocalSymbolIndex = Index;
|
||||||
|
|
||||||
for (ELFSymbolData &MSD : LocalSymbolData)
|
|
||||||
WriteSymbol(Writer, MSD, Layout);
|
|
||||||
|
|
||||||
for (ELFSymbolData &MSD : ExternalSymbolData) {
|
for (ELFSymbolData &MSD : ExternalSymbolData) {
|
||||||
|
MSD.StringIndex = StrTabBuilder.getOffset(MSD.Name);
|
||||||
|
MSD.Symbol->setIndex(Index++);
|
||||||
MCSymbolData &Data = MSD.Symbol->getData();
|
MCSymbolData &Data = MSD.Symbol->getData();
|
||||||
assert(((Data.getFlags() & ELF_STB_Global) ||
|
assert(((Data.getFlags() & ELF_STB_Global) ||
|
||||||
(Data.getFlags() & ELF_STB_Weak)) &&
|
(Data.getFlags() & ELF_STB_Weak)) &&
|
||||||
@ -978,8 +970,9 @@ void ELFObjectWriter::computeSymbolTable(
|
|||||||
WriteSymbol(Writer, MSD, Layout);
|
WriteSymbol(Writer, MSD, Layout);
|
||||||
assert(MCELF::GetBinding(Data) != ELF::STB_LOCAL);
|
assert(MCELF::GetBinding(Data) != ELF::STB_LOCAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ELFSymbolData &MSD : UndefinedSymbolData) {
|
for (ELFSymbolData &MSD : UndefinedSymbolData) {
|
||||||
|
MSD.StringIndex = StrTabBuilder.getOffset(MSD.Name);
|
||||||
|
MSD.Symbol->setIndex(Index++);
|
||||||
MCSymbolData &Data = MSD.Symbol->getData();
|
MCSymbolData &Data = MSD.Symbol->getData();
|
||||||
WriteSymbol(Writer, MSD, Layout);
|
WriteSymbol(Writer, MSD, Layout);
|
||||||
assert(MCELF::GetBinding(Data) != ELF::STB_LOCAL);
|
assert(MCELF::GetBinding(Data) != ELF::STB_LOCAL);
|
||||||
|
Loading…
Reference in New Issue
Block a user