[PATCH] D64924: [LibTooling] Add function to translate and validate source range for editing

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 18 09:20:24 PDT 2019


ilya-biryukov accepted this revision.
ilya-biryukov added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: clang/include/clang/Tooling/Refactoring/SourceCode.h:80
+llvm::Optional<CharSourceRange>
+getRangeForEdit(const CharSourceRange &EditRange, const ASTContext &Context);
 } // namespace tooling
----------------
NIT: I can see why passing two structs instead of a single `ASTContext` is annoying, but still suggest adding an overload that accepts a `SourceManager` and `LangOptions`.
(The current overload would trivially call into the other one).

The reason is that `ASTContext` is not available where you would need this function. 
In any case, having the `ASTContext` overload is convenient.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D64924





More information about the cfe-commits mailing list