Skip to content

Commit cbdb313

Browse files
committed
[GC] Hoist reached-list lookups
Move reached symbol and section list lookups out of the per-relocation path. Resolves #1754
1 parent 9ed7e64 commit cbdb313

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

lib/GarbageCollection/GarbageCollection.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,13 @@ void GarbageCollection::setUpReachedSectionsAndSymbols() {
301301
*stream << "\n" << name;
302302
}
303303

304+
// Reached symbols from section.
305+
SymbolListTy *ReachedSyms =
306+
&MSectionReachedListMap.getReachedSymbolList(*ApplySect);
307+
// Reached sections from section.
308+
SectionListTy *ReachedSects =
309+
&MSectionReachedListMap.getReachedList(*ApplySect);
310+
304311
for (auto &Reloc : ApplySect->getRelocations()) {
305312
auto RecordOneRef = [&](Relocation *Reloc) -> void {
306313
ResolveInfo *Sym = Reloc->symInfo();
@@ -310,13 +317,6 @@ void GarbageCollection::setUpReachedSectionsAndSymbols() {
310317
if (nullptr == Sym)
311318
return;
312319

313-
// Reached symbols from section.
314-
SymbolListTy *ReachedSyms =
315-
&MSectionReachedListMap.getReachedSymbolList(*ApplySect);
316-
// Reached sections from section.
317-
SectionListTy *ReachedSects =
318-
&MSectionReachedListMap.getReachedList(*ApplySect);
319-
320320
if (Sym->isBitCode()) {
321321
InputFile *Input = Sym->resolvedOrigin();
322322
Section *Bs = llvm::dyn_cast<eld::BitcodeFile>(Input)

0 commit comments

Comments
 (0)