[PATCH] D72775: [ELF] Optimization to LinkerScript::computeInputSections NFC

Andrew Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 16 05:57:02 PST 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGd36b2649e5e4: [ELF] Optimization to LinkerScript::computeInputSections NFC (authored by andrewng).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72775/new/

https://reviews.llvm.org/D72775

Files:
  lld/ELF/LinkerScript.cpp


Index: lld/ELF/LinkerScript.cpp
===================================================================
--- lld/ELF/LinkerScript.cpp
+++ lld/ELF/LinkerScript.cpp
@@ -426,10 +426,12 @@
           cast<InputSection>(sec)->getRelocatedSection())
         continue;
 
+      // Check the name early to improve performance in the common case.
+      if (!pat.sectionPat.match(sec->name))
+        continue;
+
       std::string filename = getFilename(sec->file);
-      if (!cmd->filePat.match(filename) ||
-          pat.excludedFilePat.match(filename) ||
-          !pat.sectionPat.match(sec->name))
+      if (!cmd->filePat.match(filename) || pat.excludedFilePat.match(filename))
         continue;
 
       ret.push_back(sec);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72775.238471.patch
Type: text/x-patch
Size: 722 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200116/b0c10ac2/attachment.bin>


More information about the llvm-commits mailing list