summaryrefslogtreecommitdiffstats
path: root/clang/lib/Edit/EditedSource.cpp
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
commita7d03840e695d4fd7432e9d07a61db3a9d16feeb (patch)
tree8c8141241da23d7a154a5cc316195abeaf8e554a /clang/lib/Edit/EditedSource.cpp
parenta08ed5965caf1593f8faf2175b8e074808281331 (diff)
downloadbcm5719-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.cpp14
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.
OpenPOWER on IntegriCloud