kbobyrev added inline comments.

================
Comment at: clang/include/clang/Basic/TokenKinds.h:99
 
+PPKeywordKind getPPKeywordFromSpelling(const std::string &Name);
+
----------------
riccibruno wrote:
> A string is expensive here and unneeded. Why not a `StringRef`?
Yeah, this piece is unfortunate :( `llvm::StringRef` doesn't really work with 
the current code. It relies on checking `if` using `\0` at the end of given 
string which is not always the case for `StringRef` (and `StringRef` itself 
would not be a suitable data structure to access `Name[2]` given `Name.size() 
== 2` because of the bounds check.

This is a piece I didn't figure out and hence did not send the patch to the 
review yet.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87831/new/

https://reviews.llvm.org/D87831

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to