[PATCH] D42575: [clangd] Better handling symbols defined in macros.

2018-01-31 Thread Haojian Wu via Phabricator via cfe-commits
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

[PATCH] D42575: [clangd] Better handling symbols defined in macros.

2018-01-31 Thread Haojian Wu via Phabricator via cfe-commits
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

[PATCH] D42575: [clangd] Better handling symbols defined in macros.

2018-01-31 Thread Eric Liu via Phabricator via cfe-commits
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

[PATCH] D42575: [clangd] Better handling symbols defined in macros.

2018-01-31 Thread Haojian Wu via Phabricator via cfe-commits
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

[PATCH] D42575: [clangd] Better handling symbols defined in macros.

2018-01-31 Thread Haojian Wu via Phabricator via cfe-commits
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

[PATCH] D42575: [clangd] Better handling symbols defined in macros.

2018-01-31 Thread Haojian Wu via Phabricator via cfe-commits
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

[PATCH] D42575: [clangd] Better handling symbols defined in macros.

2018-01-29 Thread Eric Liu via Phabricator via cfe-commits
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. ==

[PATCH] D42575: [clangd] Better handling symbols defined in macros.

2018-01-26 Thread Haojian Wu via Phabricator via cfe-commits
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