[PATCH] D54166: [AST] Store the string data in StringLiteral in a trailing array of chars

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 12 09:16:45 PST 2018


dblaikie added inline comments.


================
Comment at: include/clang/AST/Expr.h:1700-1701
   bool containsNonAscii() const {
-    StringRef Str = getString();
-    for (unsigned i = 0, e = Str.size(); i != e; ++i)
-      if (!isASCII(Str[i]))
+    for (auto c : getString())
+      if (!isASCII(c))
         return true;
----------------
Seems like changes like this are unrelated refactoring? Or are they in some way needed for this change? 

(also the isXXX functions above - might be neat/tidy to pull those out separately (as an NFC change) so that then this change (that modifies the implementation of getKind) is just that, without having to refactor all the other bits too? But not a big deal either way there, really)


Repository:
  rC Clang

https://reviews.llvm.org/D54166





More information about the cfe-commits mailing list