[PATCH] D44673: Make positionToOffset return llvm::Expected<size_t>

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 21 05:51:39 PDT 2018


ilya-biryukov added inline comments.


================
Comment at: clangd/SourceCode.h:41
 /// Turn an offset in Code into a [line, column] pair.
 Position offsetToPosition(llvm::StringRef Code, size_t Offset);
 
----------------
We should be consistent for all functions inside this fail. They may all fail for the same reasons, and it doesn't make sense for them to have a different interfaces.
Could you add a FIXME that we should update other functions to report errors?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D44673





More information about the cfe-commits mailing list