[lld] r317384 - [COFF] Avoid "Body" as a local variable name.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 3 15:49:02 PDT 2017
Author: ruiu
Date: Fri Nov 3 15:49:02 2017
New Revision: 317384
URL: http://llvm.org/viewvc/llvm-project?rev=317384&view=rev
Log:
[COFF] Avoid "Body" as a local variable name.
Since SymbolBody is gone, "Body" is not a good variable name.
This patch renames or eliminates them.
Modified:
lld/trunk/COFF/Chunks.cpp
lld/trunk/COFF/InputFiles.cpp
Modified: lld/trunk/COFF/Chunks.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Chunks.cpp?rev=317384&r1=317383&r2=317384&view=diff
==============================================================================
--- lld/trunk/COFF/Chunks.cpp (original)
+++ lld/trunk/COFF/Chunks.cpp Fri Nov 3 15:49:02 2017
@@ -251,8 +251,7 @@ void SectionChunk::writeTo(uint8_t *Buf)
// Get the output section of the symbol for this relocation. The output
// section is needed to compute SECREL and SECTION relocations used in debug
// info.
- Symbol *Body = File->getSymbol(Rel.SymbolTableIndex);
- Defined *Sym = cast<Defined>(Body);
+ Defined *Sym = cast<Defined>(File->getSymbol(Rel.SymbolTableIndex));
Chunk *C = Sym->getChunk();
OutputSection *OS = C ? C->getOutputSection() : nullptr;
@@ -328,8 +327,7 @@ void SectionChunk::getBaserels(std::vect
uint8_t Ty = getBaserelType(Rel);
if (Ty == IMAGE_REL_BASED_ABSOLUTE)
continue;
- Symbol *Body = File->getSymbol(Rel.SymbolTableIndex);
- if (isa<DefinedAbsolute>(Body))
+ if (isa<DefinedAbsolute>(File->getSymbol(Rel.SymbolTableIndex)))
continue;
Res->emplace_back(RVA + Rel.VirtualAddress, Ty);
}
Modified: lld/trunk/COFF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/InputFiles.cpp?rev=317384&r1=317383&r2=317384&view=diff
==============================================================================
--- lld/trunk/COFF/InputFiles.cpp (original)
+++ lld/trunk/COFF/InputFiles.cpp Fri Nov 3 15:49:02 2017
@@ -179,30 +179,30 @@ void ObjFile::initializeSymbols() {
int32_t LastSectionNumber = 0;
for (uint32_t I = 0; I < NumSymbols; ++I) {
- COFFSymbolRef Sym = check(COFFObj->getSymbol(I));
+ COFFSymbolRef COFFSym = check(COFFObj->getSymbol(I));
const void *AuxP = nullptr;
- if (Sym.getNumberOfAuxSymbols())
+ if (COFFSym.getNumberOfAuxSymbols())
AuxP = check(COFFObj->getSymbol(I + 1)).getRawPtr();
- bool IsFirst = (LastSectionNumber != Sym.getSectionNumber());
+ bool IsFirst = (LastSectionNumber != COFFSym.getSectionNumber());
- Symbol *Body = nullptr;
- if (Sym.isUndefined()) {
- Body = createUndefined(Sym);
- } else if (Sym.isWeakExternal()) {
- Body = createUndefined(Sym);
+ Symbol *Sym = nullptr;
+ if (COFFSym.isUndefined()) {
+ Sym = createUndefined(COFFSym);
+ } else if (COFFSym.isWeakExternal()) {
+ Sym = createUndefined(COFFSym);
uint32_t TagIndex =
static_cast<const coff_aux_weak_external *>(AuxP)->TagIndex;
- WeakAliases.emplace_back(Body, TagIndex);
+ WeakAliases.emplace_back(Sym, TagIndex);
} else {
- Body = createDefined(Sym, AuxP, IsFirst);
+ Sym = createDefined(COFFSym, AuxP, IsFirst);
}
- if (Body) {
- SymbolBodies.push_back(Body);
- SparseSymbolBodies[I] = Body;
+ if (Sym) {
+ SymbolBodies.push_back(Sym);
+ SparseSymbolBodies[I] = Sym;
}
- I += Sym.getNumberOfAuxSymbols();
- LastSectionNumber = Sym.getSectionNumber();
+ I += COFFSym.getNumberOfAuxSymbols();
+ LastSectionNumber = COFFSym.getSectionNumber();
}
for (auto &KV : WeakAliases) {
More information about the llvm-commits
mailing list