[PATCH] D53427: [clangd] Replace StringRef in SymbolLocation with a char pointer.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 19 09:03:35 PDT 2018


sammccall added a comment.

Nice savings!

My initial thought is that it seems weird to only do it for this one string - the readers look different, the serialization code has different logic etc for the different flavors of strings.
The struct certainly looks nicer to my eyes.

This may be the right tradeoff, but I'd like to play with/think about other options for API here. One is to define a class like `NullTerminatedStringRef` (with a better name) that wraps a char* only, but otherwise behaves as much like stringref as we can manage. Happy for you to try some of these out or to try them myself.

I think this is worth a bit of thought before committing because as shown in this patch, these APIs have quite a lot of uses!


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D53427





More information about the cfe-commits mailing list