[PATCH] D67496: [clangd] Collect macros in the preamble region of the main file

2019-09-24 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL372725: [clangd] Collect macros in the preamble region of the main file (authored by hokein, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D67496: [clangd] Collect macros in the preamble region of the main file

2019-09-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 221504. hokein added a comment. update header guard. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67496/new/ https://reviews.llvm.org/D67496 Files: clang-tools-extra/clangd/CodeComplete.cpp clang-tools-ext

[PATCH] D67496: [clangd] Collect macros in the preamble region of the main file

2019-09-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 221501. hokein marked 10 inline comments as done. hokein added a comment. Address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67496/new/ https://reviews.llvm.org/D67496 Files: clang-tools-e

[PATCH] D67496: [clangd] Collect macros in the preamble region of the main file

2019-09-24 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, thanks. A ton of small NITs too, but they're all small details. Comment at: clang-tools-extra/clangd/Macro.h:1 +//===--- Macro.h

[PATCH] D67496: [clangd] Collect macros in the preamble region of the main file

2019-09-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/Macro.h:67 + bool InMainFile = true; + std::vector &MainFileMacros; +}; ilya-biryukov wrote: > hokein wrote: > > ilya-biryukov wrote: > > > Could we model in a way that avoids duplicating macro

[PATCH] D67496: [clangd] Collect macros in the preamble region of the main file

2019-09-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 221492. hokein marked 2 inline comments as done. hokein added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67496/new/ https://reviews.llvm.org/D67496 Files: clang-tools-extra/cla

[PATCH] D67496: [clangd] Collect macros in the preamble region of the main file

2019-09-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov marked an inline comment as done. ilya-biryukov added inline comments. Comment at: clang-tools-extra/clangd/Macro.h:59 + +if (auto Range = getTokenRange(SM, LangOpts, MacroNameTok.getLocation())) { + MainFileMacros.push_back( hokein wrote:

[PATCH] D67496: [clangd] Collect macros in the preamble region of the main file

2019-09-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clang-tools-extra/clangd/Macro.h:59 + +if (auto Range = getTokenRange(SM, LangOpts, MacroNameTok.getLocation())) { + MainFileMacros.push_back( ilya-biryukov wrote: > Conve

[PATCH] D67496: [clangd] Collect macros in the preamble region of the main file

2019-09-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Sorry for the delay Comment at: clang-tools-extra/clangd/Macro.h:59 + +if (auto Range = getTokenRange(SM, LangOpts, MacroNameTok.getLocation())) { + MainFileMacros.push_back( Converting here is too early, could we keep th

[PATCH] D67496: [clangd] Collect macros in the preamble region of the main file

2019-09-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Herald added a subscriber: usaxena95. friendly ping, in case you missing it :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67496/new/ https://reviews.llvm.org/D67496 ___ cfe-c

[PATCH] D67496: [clangd] Collect macros in the preamble region of the main file

2019-09-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 219904. hokein added a comment. some cleanup Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67496/new/ https://reviews.llvm.org/D67496 Files: clang-tools-extra/clangd/CodeComplete.cpp clang-tools-extra/clang

[PATCH] D67496: [clangd] Collect macros in the preamble region of the main file

2019-09-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added subscribers: kadircet, arphaman, mgrang, jkorous, MaskRay. Herald added a project: clang. - store all macro references in the ParsedAST, which also helps to implement find references for macros. - unify the two var