[clangd] Fix build bot after r342961
authorEric Liu <ioeric@google.com>
Tue, 25 Sep 2018 11:47:14 +0000 (11:47 +0000)
committerEric Liu <ioeric@google.com>
Tue, 25 Sep 2018 11:47:14 +0000 (11:47 +0000)
Use llvm::isAlpha instead of std::isalpha etc. This should fix bot failure:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/20180

llvm-svn: 342964

clang-tools-extra/clangd/URI.cpp

index 8c297a3..0eab8f5 100644 (file)
@@ -8,6 +8,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "URI.h"
+#include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/Format.h"
@@ -15,7 +16,6 @@
 #include "llvm/Support/Path.h"
 #include <algorithm>
 #include <iomanip>
-#include <locale>
 #include <sstream>
 
 LLVM_INSTANTIATE_REGISTRY(clang::clangd::URISchemeRegistry)
@@ -134,11 +134,10 @@ std::string percentDecode(llvm::StringRef Content) {
 bool isValidScheme(llvm::StringRef Scheme) {
   if (Scheme.empty())
     return false;
-  if (!std::isalpha(Scheme[0]))
+  if (!llvm::isAlpha(Scheme[0]))
     return false;
   return std::all_of(Scheme.begin() + 1, Scheme.end(), [](char C) {
-    return std::isalpha(C) || std::isdigit(C) || C == '+' || C == '.' ||
-           C == '-';
+    return llvm::isAlnum(C) || C == '+' || C == '.' || C == '-';
   });
 }