mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-01 07:30:31 +00:00
clang-formatted ranged loops and assignment, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223344 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
206b84f324
commit
ba8180b436
@ -266,12 +266,12 @@ COFFSymbol *WinCOFFObjectWriter::createSymbol(StringRef Name) {
|
|||||||
return createCOFFEntity<COFFSymbol>(Name, Symbols);
|
return createCOFFEntity<COFFSymbol>(Name, Symbols);
|
||||||
}
|
}
|
||||||
|
|
||||||
COFFSymbol *WinCOFFObjectWriter::GetOrCreateCOFFSymbol(const MCSymbol * Symbol){
|
COFFSymbol *WinCOFFObjectWriter::GetOrCreateCOFFSymbol(const MCSymbol *Symbol) {
|
||||||
symbol_map::iterator i = SymbolMap.find(Symbol);
|
symbol_map::iterator i = SymbolMap.find(Symbol);
|
||||||
if (i != SymbolMap.end())
|
if (i != SymbolMap.end())
|
||||||
return i->second;
|
return i->second;
|
||||||
COFFSymbol *RetSymbol
|
COFFSymbol *RetSymbol =
|
||||||
= createCOFFEntity<COFFSymbol>(Symbol->getName(), Symbols);
|
createCOFFEntity<COFFSymbol>(Symbol->getName(), Symbols);
|
||||||
SymbolMap[Symbol] = RetSymbol;
|
SymbolMap[Symbol] = RetSymbol;
|
||||||
return RetSymbol;
|
return RetSymbol;
|
||||||
}
|
}
|
||||||
@ -640,7 +640,7 @@ void WinCOFFObjectWriter::ExecutePostLayoutBinding(MCAssembler &Asm,
|
|||||||
const MCAsmLayout &Layout) {
|
const MCAsmLayout &Layout) {
|
||||||
// "Define" each section & symbol. This creates section & symbol
|
// "Define" each section & symbol. This creates section & symbol
|
||||||
// entries in the staging area.
|
// entries in the staging area.
|
||||||
for (const auto & Section : Asm)
|
for (const auto &Section : Asm)
|
||||||
DefineSection(Section);
|
DefineSection(Section);
|
||||||
|
|
||||||
for (MCSymbolData &SD : Asm.symbols())
|
for (MCSymbolData &SD : Asm.symbols())
|
||||||
@ -835,7 +835,7 @@ void WinCOFFObjectWriter::WriteObject(MCAssembler &Asm,
|
|||||||
|
|
||||||
unsigned Offset = 0;
|
unsigned Offset = 0;
|
||||||
unsigned Length = FI->size();
|
unsigned Length = FI->size();
|
||||||
for (auto & Aux : file->Aux) {
|
for (auto &Aux : file->Aux) {
|
||||||
Aux.AuxType = ATFile;
|
Aux.AuxType = ATFile;
|
||||||
|
|
||||||
if (Length > SymbolSize) {
|
if (Length > SymbolSize) {
|
||||||
@ -881,7 +881,7 @@ void WinCOFFObjectWriter::WriteObject(MCAssembler &Asm,
|
|||||||
SetSymbolName(*S);
|
SetSymbolName(*S);
|
||||||
|
|
||||||
// Fixup weak external references.
|
// Fixup weak external references.
|
||||||
for (auto & Symbol : Symbols) {
|
for (auto &Symbol : Symbols) {
|
||||||
if (Symbol->Other) {
|
if (Symbol->Other) {
|
||||||
assert(Symbol->Index != -1);
|
assert(Symbol->Index != -1);
|
||||||
assert(Symbol->Aux.size() == 1 && "Symbol must contain one aux symbol!");
|
assert(Symbol->Aux.size() == 1 && "Symbol must contain one aux symbol!");
|
||||||
@ -892,7 +892,7 @@ void WinCOFFObjectWriter::WriteObject(MCAssembler &Asm,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fixup associative COMDAT sections.
|
// Fixup associative COMDAT sections.
|
||||||
for (auto & Section : Sections) {
|
for (auto &Section : Sections) {
|
||||||
if (Section->Symbol->Aux[0].Aux.SectionDefinition.Selection !=
|
if (Section->Symbol->Aux[0].Aux.SectionDefinition.Selection !=
|
||||||
COFF::IMAGE_COMDAT_SELECT_ASSOCIATIVE)
|
COFF::IMAGE_COMDAT_SELECT_ASSOCIATIVE)
|
||||||
continue;
|
continue;
|
||||||
@ -928,7 +928,7 @@ void WinCOFFObjectWriter::WriteObject(MCAssembler &Asm,
|
|||||||
offset += COFF::Header16Size;
|
offset += COFF::Header16Size;
|
||||||
offset += COFF::SectionSize * Header.NumberOfSections;
|
offset += COFF::SectionSize * Header.NumberOfSections;
|
||||||
|
|
||||||
for (const auto & Section : Asm) {
|
for (const auto &Section : Asm) {
|
||||||
COFFSection *Sec = SectionMap[&Section.getSection()];
|
COFFSection *Sec = SectionMap[&Section.getSection()];
|
||||||
|
|
||||||
if (Sec->Number == -1)
|
if (Sec->Number == -1)
|
||||||
@ -961,7 +961,7 @@ void WinCOFFObjectWriter::WriteObject(MCAssembler &Asm,
|
|||||||
|
|
||||||
offset += COFF::RelocationSize * Sec->Relocations.size();
|
offset += COFF::RelocationSize * Sec->Relocations.size();
|
||||||
|
|
||||||
for (auto & Relocation : Sec->Relocations) {
|
for (auto &Relocation : Sec->Relocations) {
|
||||||
assert(Relocation.Symb->Index != -1);
|
assert(Relocation.Symb->Index != -1);
|
||||||
Relocation.Data.SymbolTableIndex = Relocation.Symb->Index;
|
Relocation.Data.SymbolTableIndex = Relocation.Symb->Index;
|
||||||
}
|
}
|
||||||
@ -991,7 +991,7 @@ void WinCOFFObjectWriter::WriteObject(MCAssembler &Asm,
|
|||||||
sections::iterator i, ie;
|
sections::iterator i, ie;
|
||||||
MCAssembler::const_iterator j, je;
|
MCAssembler::const_iterator j, je;
|
||||||
|
|
||||||
for (auto & Section : Sections) {
|
for (auto &Section : Sections) {
|
||||||
if (Section->Number != -1) {
|
if (Section->Number != -1) {
|
||||||
if (Section->Relocations.size() >= 0xffff)
|
if (Section->Relocations.size() >= 0xffff)
|
||||||
Section->Header.Characteristics |= COFF::IMAGE_SCN_LNK_NRELOC_OVFL;
|
Section->Header.Characteristics |= COFF::IMAGE_SCN_LNK_NRELOC_OVFL;
|
||||||
@ -1027,7 +1027,7 @@ void WinCOFFObjectWriter::WriteObject(MCAssembler &Asm,
|
|||||||
WriteRelocation(r);
|
WriteRelocation(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto & Relocation : (*i)->Relocations)
|
for (const auto &Relocation : (*i)->Relocations)
|
||||||
WriteRelocation(Relocation.Data);
|
WriteRelocation(Relocation.Data);
|
||||||
} else
|
} else
|
||||||
assert((*i)->Header.PointerToRelocations == 0 &&
|
assert((*i)->Header.PointerToRelocations == 0 &&
|
||||||
@ -1038,7 +1038,7 @@ void WinCOFFObjectWriter::WriteObject(MCAssembler &Asm,
|
|||||||
assert(OS.tell() == Header.PointerToSymbolTable &&
|
assert(OS.tell() == Header.PointerToSymbolTable &&
|
||||||
"Header::PointerToSymbolTable is insane!");
|
"Header::PointerToSymbolTable is insane!");
|
||||||
|
|
||||||
for (auto & Symbol : Symbols)
|
for (auto &Symbol : Symbols)
|
||||||
if (Symbol->Index != -1)
|
if (Symbol->Index != -1)
|
||||||
WriteSymbol(*Symbol);
|
WriteSymbol(*Symbol);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user