summaryrefslogtreecommitdiff
path: root/lib/Edit
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2013-02-08 22:30:41 +0000
committerJordan Rose <jordan_rose@apple.com>2013-02-08 22:30:41 +0000
commit3f6f51e28231f65de9c2dd150a2d757b2162cfa3 (patch)
tree1e341c81fec0bf620086a1afa40f4f847dc5bdc4 /lib/Edit
parent4a04d445af4d29440371800409babc98708d98aa (diff)
downloadclang-3f6f51e28231f65de9c2dd150a2d757b2162cfa3.tar.gz
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174768 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Edit')
-rw-r--r--lib/Edit/EditedSource.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/Edit/EditedSource.cpp b/lib/Edit/EditedSource.cpp
index 002776759f..dd99ca9280 100644
--- a/lib/Edit/EditedSource.cpp
+++ b/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.