We have variant implementations in the codebase, this patch unifies them.
Details
- Reviewers
ilya-biryukov kadircet - Commits
- rGb13c264ccaf8: Merging r366541: --------------------------------------------------------------…
rL368669: Merging r366541:
rG6ae86ea27521: [clangd] cleanup: unify the implemenation of checking a location is inside main…
rL366541: [clangd] cleanup: unify the implemenation of checking a location is inside main…
rCTE366541: [clangd] cleanup: unify the implemenation of checking a location is inside main…
Diff Detail
- Repository
- rL LLVM
Event Timeline
Neat! Many thanks, that's a very useful cleanup.
A few suggestions from my side.
clang-tools-extra/clangd/SourceCode.cpp | ||
---|---|---|
332 ↗ | (On Diff #210542) | NIT: why not getExpansionLoc? Its implementation and description seems simpler and (I believe) it produces locations inside the same files as getFileLoc (as both the macro arg and the macro name of the expansion are always coming from the same file) |
clang-tools-extra/clangd/SourceCode.h | ||
81 ↗ | (On Diff #210542) | Could we add a description without mentioning other SourceManager functions here? For macro locations, returns iff the macro is being expanded inside the main file. |
clang-tools-extra/clangd/SourceCode.cpp | ||
---|---|---|
332 ↗ | (On Diff #210542) | yes, since we are checking the file (not the range), there is no difference between these two methods. Changed to getExpansionLoc |
LGTM
clang-tools-extra/clangd/unittests/SourceCodeTests.cpp | ||
---|---|---|
448 ↗ | (On Diff #210569) | NIT: not sure if it's easy to get a hold of those, but ... |