summaryrefslogtreecommitdiff
path: root/tools/gold
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2017-10-04 11:00:30 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2017-10-04 11:00:30 +0000
commitc7c50afdcad93433729e71b77e10957b342f1169 (patch)
treec620c7f6b32c52b0caaf90debe3cfe9d12c40d4f /tools/gold
parentc54be30bc811319cf8fb7483a3f48c870c209215 (diff)
[gold-plugin] - Fix compilation after LLVM update (r314883). NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314899 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/gold')
-rw-r--r--tools/gold/gold-plugin.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/tools/gold/gold-plugin.cpp b/tools/gold/gold-plugin.cpp
index b0538b359f0..9c6de14af65 100644
--- a/tools/gold/gold-plugin.cpp
+++ b/tools/gold/gold-plugin.cpp
@@ -608,16 +608,11 @@ static std::string getThinLTOObjectFileName(StringRef Path, StringRef OldSuffix,
return NewNewPath;
}
-static bool isAlpha(char C) {
- return ('a' <= C && C <= 'z') || ('A' <= C && C <= 'Z') || C == '_';
-}
-
-static bool isAlnum(char C) { return isAlpha(C) || ('0' <= C && C <= '9'); }
-
// Returns true if S is valid as a C language identifier.
static bool isValidCIdentifier(StringRef S) {
- return !S.empty() && isAlpha(S[0]) &&
- std::all_of(S.begin() + 1, S.end(), isAlnum);
+ return !S.empty() && (isAlpha(S[0]) || S[0] == '_') &&
+ std::all_of(S.begin() + 1, S.end(),
+ [](char C) { return C == '_' || isAlnum(C); });
}
static void addModule(LTO &Lto, claimed_file &F, const void *View,