Skip to content

Commit 010514f

Browse files
committed
Remove isNumber checks
1 parent e8a9a46 commit 010514f

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

lld/MachO/BPSectionOrderer.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,14 @@
2121
using namespace llvm;
2222
using namespace lld::macho;
2323

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-
2924
/// Symbols can be appended with "(.__uniq.xxxx)?.llvm.yyyy" where "xxxx" and
3025
/// "yyyy" are numbers that could change between builds. We need to use the root
3126
/// symbol name before this suffix so these symbols can be matched with profiles
3227
/// which may have different suffixes.
3328
static StringRef getRootSymbol(StringRef Name) {
3429
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;
4132
}
4233

4334
static uint64_t getRelocHash(StringRef kind, uint64_t sectionIdx,

0 commit comments

Comments
 (0)