From: Rui Ueyama Date: Thu, 17 Nov 2016 03:19:34 +0000 (+0000) Subject: Simplify handleAnonymousVersion even more. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=77d917de578bf0adb0100959ef8a8ccb0817b373;p=platform%2Fupstream%2Fllvm.git Simplify handleAnonymousVersion even more. We used to create a vector contantaining all version definitions with wildcards because doing that was efficient. All patterns were compiled to a regexp and matched against symbol names. Because a regexp can be converted to a DFA, matching against union of patterns is as cheap as matching against one patter. We are no longer converting them to regexp. Our own glob pattern handler doesn't do such optimization. Therefore, creating a vector no longer makes sense. llvm-svn: 287196 --- diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp index 949e7fc..268196d 100644 --- a/lld/ELF/SymbolTable.cpp +++ b/lld/ELF/SymbolTable.cpp @@ -634,18 +634,15 @@ SymbolTable::findAllDemangled(const StringMatcher &M) { // in the form of { global: foo; bar; local *; }. So, local is default. // In this function, we make specified symbols global. template void SymbolTable::handleAnonymousVersion() { - std::vector Patterns; for (SymbolVersion &Ver : Config->VersionScriptGlobals) { if (hasWildcard(Ver.Name)) { - Patterns.push_back(Ver.Name); + for (SymbolBody *B : findAll(StringMatcher({Ver.Name}))) + B->symbol()->VersionId = VER_NDX_GLOBAL; continue; } if (SymbolBody *B = find(Ver.Name)) B->symbol()->VersionId = VER_NDX_GLOBAL; } - if (!Patterns.empty()) - for (SymbolBody *B : findAll(StringMatcher(Patterns))) - B->symbol()->VersionId = VER_NDX_GLOBAL; } // Set symbol versions to symbols. This function handles patterns