[PATCH] D87469: [LLD][ELF] Optimize linker script filename glob pattern matching NFC

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 14 17:19:31 PDT 2020


MaskRay added inline comments.


================
Comment at: lld/ELF/InputFiles.cpp:282
+  if (nameForScriptCache.empty())
+    nameForScriptCache = (archiveName + ':' + getName()).str();
+
----------------
`Twine(':')`


================
Comment at: lld/ELF/LinkerScript.cpp:348
 bool LinkerScript::shouldKeep(InputSectionBase *s) {
   if (keptSections.empty())
     return false;
----------------
Delete the two lines.


================
Comment at: lld/ELF/LinkerScript.h:153
+
+  // Cache of the most recent result of excludesFile().
+  mutable llvm::Optional<std::pair<const InputFile *, bool>> excludesFileCache;
----------------
... and the argument.


================
Comment at: lld/ELF/LinkerScript.h:173
+  // Cache of the most recent result of matchesFile().
+  mutable llvm::Optional<std::pair<const InputFile *, bool>> matchesFileCache;
+
----------------
... and the argument.


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

https://reviews.llvm.org/D87469



More information about the llvm-commits mailing list