================ @@ -36,7 +36,14 @@ using DiagOrStoredDiag = /// Maps both endpoints of \p Range to their macro expansion, so that the range /// can be shown to a user. /// -/// \returns nullopt if \p Range is invalid, if an endpoint lies outside \p FID. +/// \returns nullopt if \p Range is invalid, if an endpoint lies outside \p FID, +/// Unlike \c Lexer::makeFileCharRange(), which gives up when an endpoint is +/// strictly inside an expansion, this points at the expansion; prefer +/// \c makeFileCharRange() when a faithful file range matters, e.g. for +/// rewriting. +/// +/// The result may still be a token range, but \c Lexer::getAsCharRange() cannot +/// fail on it: both endpoints are file locations. ---------------- NagyDonat wrote:
I don't see the correspondence between this comment update and the code change (which introduces the postcondition for the returned range its begin is <= its end). https://github.com/llvm/llvm-project/pull/214461 _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
