File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change 21
21
using namespace llvm ;
22
22
using namespace lld ::macho;
23
23
24
- // TODO: Move to StringRef.h
25
- static bool isNumber (StringRef S) {
26
- return !S.empty () && S.find_first_not_of (" 0123456789" ) == StringRef::npos;
27
- }
28
-
29
24
// / Symbols can be appended with "(.__uniq.xxxx)?.llvm.yyyy" where "xxxx" and
30
25
// / "yyyy" are numbers that could change between builds. We need to use the root
31
26
// / symbol name before this suffix so these symbols can be matched with profiles
32
27
// / which may have different suffixes.
33
28
static StringRef getRootSymbol (StringRef Name) {
34
29
auto [P0, S0] = Name.rsplit (" .llvm." );
35
- if (isNumber (S0))
36
- Name = P0;
37
- auto [P1, S1] = Name.rsplit (" .__uniq." );
38
- if (isNumber (S1))
39
- return P1;
40
- return Name;
30
+ auto [P1, S1] = P0.rsplit (" .__uniq." );
31
+ return P1;
41
32
}
42
33
43
34
static uint64_t getRelocHash (StringRef kind, uint64_t sectionIdx,
You can’t perform that action at this time.
0 commit comments