diff options
author | Jordan Rose <jordan_rose@apple.com> | 2013-02-08 22:30:41 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2013-02-08 22:30:41 +0000 |
commit | a7d03840e695d4fd7432e9d07a61db3a9d16feeb (patch) | |
tree | 8c8141241da23d7a154a5cc316195abeaf8e554a /clang/lib/Edit/EditedSource.cpp | |
parent | a08ed5965caf1593f8faf2175b8e074808281331 (diff) | |
download | bcm5719-llvm-a7d03840e695d4fd7432e9d07a61db3a9d16feeb.tar.gz bcm5719-llvm-a7d03840e695d4fd7432e9d07a61db3a9d16feeb.zip |
Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.
Nearly all of these changes are one-to-one replacements; the few that
aren't have to do with custom identifier validation.
llvm-svn: 174768
Diffstat (limited to 'clang/lib/Edit/EditedSource.cpp')
-rw-r--r-- | clang/lib/Edit/EditedSource.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/clang/lib/Edit/EditedSource.cpp b/clang/lib/Edit/EditedSource.cpp index 002776759fe..dd99ca92801 100644 --- a/clang/lib/Edit/EditedSource.cpp +++ b/clang/lib/Edit/EditedSource.cpp @@ -8,13 +8,13 @@ //===----------------------------------------------------------------------===// #include "clang/Edit/EditedSource.h" +#include "clang/Basic/CharInfo.h" #include "clang/Basic/SourceManager.h" #include "clang/Edit/Commit.h" #include "clang/Edit/EditsReceiver.h" #include "clang/Lex/Lexer.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/Twine.h" -#include <cctype> using namespace clang; using namespace edit; @@ -240,16 +240,12 @@ bool EditedSource::commit(const Commit &commit) { return true; } -static inline bool isIdentifierChar(char c, const LangOptions &LangOpts) { - return std::isalnum(c) || c == '_' || (c == '$' && LangOpts.DollarIdents); -} - // \brief Returns true if it is ok to make the two given characters adjacent. static bool canBeJoined(char left, char right, const LangOptions &LangOpts) { - // FIXME: Should use the Lexer to make sure we don't allow stuff like + // FIXME: Should use TokenConcatenation to make sure we don't allow stuff like // making two '<' adjacent. - return !(isIdentifierChar(left, LangOpts) && - isIdentifierChar(right, LangOpts)); + return !(Lexer::isIdentifierBodyChar(left, LangOpts) && + Lexer::isIdentifierBodyChar(right, LangOpts)); } /// \brief Returns true if it is ok to eliminate the trailing whitespace between @@ -258,7 +254,7 @@ static bool canRemoveWhitespace(char left, char beforeWSpace, char right, const LangOptions &LangOpts) { if (!canBeJoined(left, right, LangOpts)) return false; - if (std::isspace(left) || std::isspace(right)) + if (isWhitespace(left) || isWhitespace(right)) return true; if (canBeJoined(beforeWSpace, right, LangOpts)) return false; // the whitespace was intentional, keep it. |