File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed
Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -2976,8 +2976,7 @@ void RewriteInstance::selectFunctionsToProcess() {
29762976 populateFunctionNames (opts::FunctionNamesFileNR, opts::ForceFunctionNamesNR);
29772977
29782978 // Make a set of functions to process to speed up lookups.
2979- std::unordered_set<std::string> ForceFunctionsNR (
2980- opts::ForceFunctionNamesNR.begin (), opts::ForceFunctionNamesNR.end ());
2979+ StringSet<> ForceFunctionsNR (opts::ForceFunctionNamesNR);
29812980
29822981 if ((!opts::ForceFunctionNames.empty () ||
29832982 !opts::ForceFunctionNamesNR.empty ()) &&
@@ -3051,9 +3050,10 @@ void RewriteInstance::selectFunctionsToProcess() {
30513050 return true ;
30523051
30533052 // Non-regex check (-funcs-no-regex and -funcs-file-no-regex).
3054- for (const StringRef Name : Function.getNames ())
3055- if (ForceFunctionsNR.count (Name.str ()))
3056- return true ;
3053+ if (Function.forEachName ([&](StringRef Name) {
3054+ return ForceFunctionsNR.contains (NameResolver::restore (Name));
3055+ }))
3056+ return true ;
30573057
30583058 return false ;
30593059 }
Original file line number Diff line number Diff line change 1+ ## Checks handling of function names passed via -funcs-no-regex
2+
3+ # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
4+ # RUN: ld.lld %t.o -o %t.exe -nostdlib
5+ # RUN: llvm-bolt %t.exe -o %t.out -funcs-no-regex=func -print-cfg | FileCheck %s
6+ # CHECK: Binary Function "func/1"
7+
8+ .globl _start
9+ .type _start, @function
10+ _start:
11+ ret
12+ .size _start, .-_start
13+
14+ .type func, @function
15+ func:
16+ ud2
You can’t perform that action at this time.
0 commit comments