[ELF] Improve --export-dynamic-symbol performance by checking whether wildcard is...
authorFangrui Song <maskray@google.com>
Thu, 18 Jun 2020 00:11:38 +0000 (17:11 -0700)
committerFangrui Song <maskray@google.com>
Thu, 18 Jun 2020 00:12:10 +0000 (17:12 -0700)
commit49279ca160183c1567e2637f88f3e92eb458c3e7
tree466d8244466f0f4cc4252148b61934c0734aa560
parent7ee758d691b2afc2f130ba3a8f8507fb6415f1d9
[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.
lld/ELF/Driver.cpp
lld/ELF/ScriptParser.cpp
lld/ELF/ScriptParser.h
lld/test/ELF/export-dynamic-symbol.s