aboutsummaryrefslogtreecommitdiff
path: root/lld/ELF/ScriptParser.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2020-06-17 17:11:38 -0700
committerFangrui Song <maskray@google.com>2020-06-17 17:12:10 -0700
commit49279ca160183c1567e2637f88f3e92eb458c3e7 (patch)
tree466d8244466f0f4cc4252148b61934c0734aa560 /lld/ELF/ScriptParser.cpp
parent7ee758d691b2afc2f130ba3a8f8507fb6415f1d9 (diff)
downloadllvm-49279ca160183c1567e2637f88f3e92eb458c3e7.zip
llvm-49279ca160183c1567e2637f88f3e92eb458c3e7.tar.gz
llvm-49279ca160183c1567e2637f88f3e92eb458c3e7.tar.bz2
[ELF] Improve --export-dynamic-symbol performance by checking whether wildcard is really used
A hasWildcard pattern iterates over symVector, which can be slow when there are many --export-dynamic-symbol. In optimistic cases, most patterns don't use a wildcard character. hasWildcard: false can avoid a symbol table iteration. While here, add two tests using `[` and `?`, respectively.
Diffstat (limited to 'lld/ELF/ScriptParser.cpp')
-rw-r--r--lld/ELF/ScriptParser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp
index d23a46d2..fea6b7a 100644
--- a/lld/ELF/ScriptParser.cpp
+++ b/lld/ELF/ScriptParser.cpp
@@ -1474,7 +1474,7 @@ void ScriptParser::readVersionDeclaration(StringRef verStr) {
expect(";");
}
-static bool hasWildcard(StringRef s) {
+bool elf::hasWildcard(StringRef s) {
return s.find_first_of("?*[") != StringRef::npos;
}