[lld] 4d38d76 - [ELF] Change vector<Symbol *> to SmallVector. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 1 00:16:46 PST 2022


Author: Fangrui Song
Date: 2022-02-01T00:16:42-08:00
New Revision: 4d38d7684ce763afd31518fffad5910f809992f0

URL: https://github.com/llvm/llvm-project/commit/4d38d7684ce763afd31518fffad5910f809992f0
DIFF: https://github.com/llvm/llvm-project/commit/4d38d7684ce763afd31518fffad5910f809992f0.diff

LOG: [ELF] Change vector<Symbol *> to SmallVector. NFC

Added: 
    

Modified: 
    lld/ELF/Driver.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index a1daae6e0e9b..716523cf158f 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -1719,7 +1719,7 @@ static void handleUndefinedGlob(StringRef arg) {
 
   // Calling sym->extract() in the loop is not safe because it may add new
   // symbols to the symbol table, invalidating the current iterator.
-  std::vector<Symbol *> syms;
+  SmallVector<Symbol *, 0> syms;
   for (Symbol *sym : symtab->symbols())
     if (!sym->isPlaceholder() && pat->match(sym->getName()))
       syms.push_back(sym);


        


More information about the llvm-commits mailing list