diff --git a/libc/src/ctype/ctype_utils.h b/libc/src/__support/ctype_utils.h rename from libc/src/ctype/ctype_utils.h rename to libc/src/__support/ctype_utils.h --- a/libc/src/ctype/ctype_utils.h +++ b/libc/src/__support/ctype_utils.h @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_LIBC_SRC_CTYPE_CTYPE_UTILS_H -#define LLVM_LIBC_SRC_CTYPE_CTYPE_UTILS_H +#ifndef LLVM_LIBC_SRC_SUPPORT_CTYPE_UTILS_H +#define LLVM_LIBC_SRC_SUPPORT_CTYPE_UTILS_H namespace __llvm_libc { namespace internal { @@ -30,7 +30,11 @@ static constexpr int isupper(unsigned ch) { return (ch - 'A') < 26; } +static constexpr int isspace(unsigned ch) { + return ch == ' ' || (ch - '\t') < 5; +} + } // namespace internal } // namespace __llvm_libc -#endif // LLVM_LIBC_SRC_CTYPE_CTYPE_UTILS_H +#endif // LLVM_LIBC_SRC_SUPPORT_CTYPE_UTILS_H diff --git a/libc/src/ctype/isalnum.cpp b/libc/src/ctype/isalnum.cpp --- a/libc/src/ctype/isalnum.cpp +++ b/libc/src/ctype/isalnum.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// #include "src/ctype/isalnum.h" -#include "src/ctype/ctype_utils.h" +#include "src/__support/ctype_utils.h" #include "src/__support/common.h" diff --git a/libc/src/ctype/isalpha.cpp b/libc/src/ctype/isalpha.cpp --- a/libc/src/ctype/isalpha.cpp +++ b/libc/src/ctype/isalpha.cpp @@ -9,7 +9,7 @@ #include "src/ctype/isalpha.h" #include "src/__support/common.h" -#include "src/ctype/ctype_utils.h" +#include "src/__support/ctype_utils.h" namespace __llvm_libc { diff --git a/libc/src/ctype/isdigit.cpp b/libc/src/ctype/isdigit.cpp --- a/libc/src/ctype/isdigit.cpp +++ b/libc/src/ctype/isdigit.cpp @@ -8,7 +8,7 @@ #include "src/ctype/isdigit.h" #include "src/__support/common.h" -#include "src/ctype/ctype_utils.h" +#include "src/__support/ctype_utils.h" namespace __llvm_libc { diff --git a/libc/src/ctype/isgraph.cpp b/libc/src/ctype/isgraph.cpp --- a/libc/src/ctype/isgraph.cpp +++ b/libc/src/ctype/isgraph.cpp @@ -9,7 +9,7 @@ #include "src/ctype/isgraph.h" #include "src/__support/common.h" -#include "src/ctype/ctype_utils.h" +#include "src/__support/ctype_utils.h" namespace __llvm_libc { diff --git a/libc/src/ctype/islower.cpp b/libc/src/ctype/islower.cpp --- a/libc/src/ctype/islower.cpp +++ b/libc/src/ctype/islower.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// #include "src/ctype/islower.h" -#include "src/ctype/ctype_utils.h" +#include "src/__support/ctype_utils.h" #include "src/__support/common.h" diff --git a/libc/src/ctype/ispunct.cpp b/libc/src/ctype/ispunct.cpp --- a/libc/src/ctype/ispunct.cpp +++ b/libc/src/ctype/ispunct.cpp @@ -9,7 +9,7 @@ #include "src/ctype/ispunct.h" #include "src/__support/common.h" -#include "src/ctype/ctype_utils.h" +#include "src/__support/ctype_utils.h" namespace __llvm_libc { diff --git a/libc/src/ctype/isspace.cpp b/libc/src/ctype/isspace.cpp --- a/libc/src/ctype/isspace.cpp +++ b/libc/src/ctype/isspace.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// #include "src/ctype/isspace.h" +#include "src/__support/ctype_utils.h" #include "src/__support/common.h" @@ -14,9 +15,6 @@ // TODO: Currently restricted to default locale. // These should be extended using locale information. -LLVM_LIBC_FUNCTION(int, isspace, (int c)) { - const unsigned ch = c; - return ch == ' ' || (ch - '\t') < 5; -} +LLVM_LIBC_FUNCTION(int, isspace, (int c)) { return internal::isspace(c); } } // namespace __llvm_libc diff --git a/libc/src/ctype/isupper.cpp b/libc/src/ctype/isupper.cpp --- a/libc/src/ctype/isupper.cpp +++ b/libc/src/ctype/isupper.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// #include "src/ctype/isupper.h" -#include "src/ctype/ctype_utils.h" +#include "src/__support/ctype_utils.h" #include "src/__support/common.h" diff --git a/libc/src/ctype/isxdigit.cpp b/libc/src/ctype/isxdigit.cpp --- a/libc/src/ctype/isxdigit.cpp +++ b/libc/src/ctype/isxdigit.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// #include "src/ctype/isxdigit.h" -#include "src/ctype/ctype_utils.h" +#include "src/__support/ctype_utils.h" #include "src/__support/common.h" diff --git a/libc/src/ctype/tolower.cpp b/libc/src/ctype/tolower.cpp --- a/libc/src/ctype/tolower.cpp +++ b/libc/src/ctype/tolower.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// #include "src/ctype/tolower.h" -#include "src/ctype/ctype_utils.h" +#include "src/__support/ctype_utils.h" #include "src/__support/common.h" diff --git a/libc/src/ctype/toupper.cpp b/libc/src/ctype/toupper.cpp --- a/libc/src/ctype/toupper.cpp +++ b/libc/src/ctype/toupper.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// #include "src/ctype/toupper.h" -#include "src/ctype/ctype_utils.h" +#include "src/__support/ctype_utils.h" #include "src/__support/common.h"