[lld] e59d9df - [ELF] --symbol-ordering-file: optimize a loop
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 7 21:47:40 PDT 2020
Author: Fangrui Song
Date: 2020-09-07T21:47:30-07:00
New Revision: e59d9df774ed7d94455b224f0e3f6eaeae707259
URL: https://github.com/llvm/llvm-project/commit/e59d9df774ed7d94455b224f0e3f6eaeae707259
DIFF: https://github.com/llvm/llvm-project/commit/e59d9df774ed7d94455b224f0e3f6eaeae707259.diff
LOG: [ELF] --symbol-ordering-file: optimize a loop
Added:
Modified:
lld/ELF/Writer.cpp
Removed:
################################################################################
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index b26817b66e27..5ef37e9ecb89 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -1346,9 +1346,11 @@ static DenseMap<const InputSectionBase *, int> buildSectionOrder() {
addSym(*sym);
for (InputFile *file : objectFiles)
- for (Symbol *sym : file->getSymbols())
- if (sym->isLocal())
- addSym(*sym);
+ for (Symbol *sym : file->getSymbols()) {
+ if (!sym->isLocal())
+ break;
+ addSym(*sym);
+ }
if (config->warnSymbolOrdering)
for (auto orderEntry : symbolOrder)
More information about the llvm-commits
mailing list