Adds the function getRangeForEdit to validate that a given source range is
editable and, if needed, translate it into a range in the source file (for
example, if it's sourced in macro expansions).
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 35259 Build 35258: arc lint + arc unit
Event Timeline
Comment Actions
LGTM
clang/include/clang/Tooling/Refactoring/SourceCode.h | ||
---|---|---|
80 | 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 reason is that ASTContext is not available where you would need this function. |
clang/include/clang/Tooling/Refactoring/SourceCode.h | ||
---|---|---|
80 | good point! |
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.