This revision was automatically updated to reflect the committed changes.
Closed by commit rL323867: [clangd] Better handling symbols defined in macros.
(authored by hokein, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D42575?vs=1321
This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE323867: [clangd] Better handling symbols defined in
macros. (authored by hokein, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D42575?vs=132123&id=132143#toc
Repository:
rL LLVM
ioeric accepted this revision.
ioeric added a comment.
This revision is now accepted and ready to land.
lg
Comment at: clangd/index/SymbolCollector.cpp:127
+// location instead.
+if (llvm::StringRef(PrintableLoc(Loc, SM)).startswith(" ioeric wrote:
> > To reduce some co
hokein added inline comments.
Comment at: clangd/index/SymbolCollector.cpp:108
+std::string PrintableLoc(SourceLocation Loc, SourceManager &SM) {
+ if (Loc.isInvalid())
ioeric wrote:
> `PrintLoc`? `PrintableLoc` sounds like a checker for whether a location is
hokein updated this revision to Diff 132123.
hokein added a comment.
Update test.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D42575
Files:
clangd/index/SymbolCollector.cpp
unittests/clangd/Annotations.cpp
unittests/clangd/Annotations.h
unittests/clangd/SymbolCollecto
hokein updated this revision to Diff 132122.
hokein marked 4 inline comments as done.
hokein added a comment.
- address review comments.
- add tests for indexing main files
- use SourceLocation.printToString
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D42575
Files:
clangd/i
ioeric added inline comments.
Comment at: clangd/index/SymbolCollector.cpp:108
+std::string PrintableLoc(SourceLocation Loc, SourceManager &SM) {
+ if (Loc.isInvalid())
`PrintLoc`? `PrintableLoc` sounds like a checker for whether a location is
printable.
==
hokein created this revision.
hokein added a reviewer: ioeric.
Herald added subscribers: jkorous-apple, ilya-biryukov, klimek.
For symbols defined inside macros:
- use expansion location, if the symbol is formed via macro concatenation.
- use spelling location, otherwise.
This will fix some symb