[PATCH] D44293: [clangd] Fix irrelevant declaratations in goto definition (on macros).

2018-03-13 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE327387: [clangd] Fix irrelevant declaratations in goto definition (on macros). (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D44293?vs=138160=138162#toc

[PATCH] D44293: [clangd] Fix irrelevant declaratations in goto definition (on macros).

2018-03-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 138160. hokein marked an inline comment as done. hokein added a comment. Rephrase the fixme. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44293 Files: clangd/XRefs.cpp unittests/clangd/XRefsTests.cpp Index:

[PATCH] D44293: [clangd] Fix irrelevant declaratations in goto definition (on macros).

2018-03-13 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM with a small nit about the comment. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44293 ___ cfe-commits

[PATCH] D44293: [clangd] Fix irrelevant declaratations in goto definition (on macros).

2018-03-13 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/XRefs.cpp:137 + // + // FIXME: Exclude declarations from macros. + Decls.clear(); NIT: the fixme was a bit hard to follow for me. Maybe make it more clear where the problem

[PATCH] D44293: [clangd] Fix irrelevant declaratations in goto definition (on macros).

2018-03-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/XRefs.cpp:201 std::vector MacroInfos = DeclMacrosFinder->takeMacroInfos(); + if (!MacroInfos.empty()) { +for (auto Item : MacroInfos) { ilya-biryukov wrote: > hokein wrote: > > ilya-biryukov wrote: > > > I

[PATCH] D44293: [clangd] Fix irrelevant declaratations in goto definition (on macros).

2018-03-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 138147. hokein marked an inline comment as done. hokein added a comment. Address review comment. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44293 Files: clangd/XRefs.cpp unittests/clangd/XRefsTests.cpp Index:

[PATCH] D44293: [clangd] Fix irrelevant declaratations in goto definition (on macros).

2018-03-13 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/XRefs.cpp:201 std::vector MacroInfos = DeclMacrosFinder->takeMacroInfos(); + if (!MacroInfos.empty()) { +for (auto Item : MacroInfos) { hokein wrote: > ilya-biryukov wrote: > > I wonder whether we

[PATCH] D44293: [clangd] Fix irrelevant declaratations in goto definition (on macros).

2018-03-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/XRefs.cpp:201 std::vector MacroInfos = DeclMacrosFinder->takeMacroInfos(); + if (!MacroInfos.empty()) { +for (auto Item : MacroInfos) { ilya-biryukov wrote: > I wonder whether we should fix the

[PATCH] D44293: [clangd] Fix irrelevant declaratations in goto definition (on macros).

2018-03-12 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/XRefs.cpp:201 std::vector MacroInfos = DeclMacrosFinder->takeMacroInfos(); + if (!MacroInfos.empty()) { +for (auto Item : MacroInfos) { I wonder whether we should fix the `DeclrationAndMacrosFinder`

[PATCH] D44293: [clangd] Fix irrelevant declaratations in goto definition (on macros).

2018-03-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added subscribers: ioeric, jkorous-apple, klimek. DeclrationAndMacrosFinder will find some declarations (not macro!) that are referened inside the macro somehow, isSearchedLocation() is not sufficient, we don't know