[lld] r318636 - COFF: Change SparseChunks to be of type std::vector<SectionChunk *>. NFC.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 19 21:31:23 PST 2017
Author: pcc
Date: Sun Nov 19 21:31:23 2017
New Revision: 318636
URL: http://llvm.org/viewvc/llvm-project?rev=318636&view=rev
Log:
COFF: Change SparseChunks to be of type std::vector<SectionChunk *>. NFC.
Modified:
lld/trunk/COFF/InputFiles.cpp
lld/trunk/COFF/InputFiles.h
Modified: lld/trunk/COFF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/InputFiles.cpp?rev=318636&r1=318635&r2=318636&view=diff
==============================================================================
--- lld/trunk/COFF/InputFiles.cpp (original)
+++ lld/trunk/COFF/InputFiles.cpp Sun Nov 19 21:31:23 2017
@@ -259,7 +259,7 @@ Symbol *ObjFile::createDefined(COFFSymbo
fatal("broken object file: " + toString(this));
// Nothing else to do without a section chunk.
- auto *SC = cast_or_null<SectionChunk>(SparseChunks[SectionNumber]);
+ auto *SC = SparseChunks[SectionNumber];
if (!SC)
return nullptr;
@@ -267,8 +267,7 @@ Symbol *ObjFile::createDefined(COFFSymbo
if (IsFirst && AuxP) {
auto *Aux = reinterpret_cast<const coff_aux_section_definition *>(AuxP);
if (Aux->Selection == IMAGE_COMDAT_SELECT_ASSOCIATIVE)
- if (auto *ParentSC = cast_or_null<SectionChunk>(
- SparseChunks[Aux->getNumber(Sym.isBigObj())])) {
+ if (auto *ParentSC = SparseChunks[Aux->getNumber(Sym.isBigObj())]) {
ParentSC->addAssociative(SC);
// If we already discarded the parent, discard the child.
if (ParentSC->isDiscarded())
Modified: lld/trunk/COFF/InputFiles.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/InputFiles.h?rev=318636&r1=318635&r2=318636&view=diff
==============================================================================
--- lld/trunk/COFF/InputFiles.h (original)
+++ lld/trunk/COFF/InputFiles.h Sun Nov 19 21:31:23 2017
@@ -160,7 +160,7 @@ private:
// Nonexistent section indices are filled with null pointers.
// (Because section number is 1-based, the first slot is always a
// null pointer.)
- std::vector<Chunk *> SparseChunks;
+ std::vector<SectionChunk *> SparseChunks;
// List of all symbols referenced or defined by this file.
std::vector<Symbol *> SymbolBodies;
More information about the llvm-commits
mailing list