[ELF] - Update after LLVM r314883 change. NFC.
llvm-svn: 314884
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index 00df8a4..cfe8ae7 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -933,7 +933,7 @@
   // characters in a filename are replaced with underscore.
   std::string S = "_binary_" + MB.getBufferIdentifier().str();
   for (size_t I = 0; I < S.size(); ++I)
-    if (!elf::isAlnum(S[I]))
+    if (!isAlnum(S[I]))
       S[I] = '_';
 
   Symtab->addRegular<ELFT>(Saver.save(S + "_start"), STV_DEFAULT, STT_OBJECT,
diff --git a/lld/ELF/Strings.cpp b/lld/ELF/Strings.cpp
index 923aad5..766258f 100644
--- a/lld/ELF/Strings.cpp
+++ b/lld/ELF/Strings.cpp
@@ -54,18 +54,11 @@
   return Hex;
 }
 
-static bool isAlpha(char C) {
-  return ('a' <= C && C <= 'z') || ('A' <= C && C <= 'Z') || C == '_';
-}
-
-// Returns true if C is a valid letter, digit or underscore as defined in the
-// "C" locale.
-bool elf::isAlnum(char C) { return isAlpha(C) || ('0' <= C && C <= '9'); }
-
 // Returns true if S is valid as a C language identifier.
 bool elf::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); });
 }
 
 // Returns the demangled C++ symbol name for Name.
diff --git a/lld/ELF/Strings.h b/lld/ELF/Strings.h
index aef9a92..3c7e744 100644
--- a/lld/ELF/Strings.h
+++ b/lld/ELF/Strings.h
@@ -22,7 +22,6 @@
 namespace elf {
 
 std::vector<uint8_t> parseHex(StringRef S);
-bool isAlnum(char C);
 bool isValidCIdentifier(StringRef S);
 
 // This is a lazy version of StringRef. String size is computed lazily