r189115 - Use CharInfo.h routines in TextComment::isWhitespaceNoCache

Dmitri Gribenko gribozavr at gmail.com
Fri Aug 23 10:45:43 PDT 2013


Author: gribozavr
Date: Fri Aug 23 12:45:43 2013
New Revision: 189115

URL: http://llvm.org/viewvc/llvm-project?rev=189115&view=rev
Log:
Use CharInfo.h routines in TextComment::isWhitespaceNoCache

Modified:
    cfe/trunk/lib/AST/Comment.cpp

Modified: cfe/trunk/lib/AST/Comment.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Comment.cpp?rev=189115&r1=189114&r2=189115&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Comment.cpp (original)
+++ cfe/trunk/lib/AST/Comment.cpp Fri Aug 23 12:45:43 2013
@@ -12,6 +12,7 @@
 #include "clang/AST/Decl.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/DeclTemplate.h"
+#include "clang/Basic/CharInfo.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/raw_ostream.h"
 
@@ -94,9 +95,7 @@ Comment::child_iterator Comment::child_e
 bool TextComment::isWhitespaceNoCache() const {
   for (StringRef::const_iterator I = Text.begin(), E = Text.end();
        I != E; ++I) {
-    const char C = *I;
-    if (C != ' ' && C != '\n' && C != '\r' &&
-        C != '\t' && C != '\f' && C != '\v')
+    if (!clang::isWhitespace(*I))
       return false;
   }
   return true;





More information about the cfe-commits mailing list