[PATCH] D54999: [clangd] Populate include graph during static indexing action.

2018-11-30 Thread Kadir Cetinkaya via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL348005: [clangd] Populate include graph during static indexing action. (authored by kadircet, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES SINCE LAST ACTION

[PATCH] D54999: [clangd] Populate include graph during static indexing action.

2018-11-30 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 176144. kadircet marked 2 inline comments as done. kadircet added a comment. - Address comments Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54999/new/ https://reviews.llvm.org/D54999 Files:

[PATCH] D54999: [clangd] Populate include graph during static indexing action.

2018-11-30 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. Thank, LGTM. A few NITs. Comment at: clangd/index/IndexAction.h:31 +std::function RefsCallback, +std::function IncludeGraphCallback = nullptr);

[PATCH] D54999: [clangd] Populate include graph during static indexing action.

2018-11-30 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 176065. kadircet marked 4 inline comments as done. kadircet added a comment. - Address comments. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54999/new/ https://reviews.llvm.org/D54999 Files:

[PATCH] D54999: [clangd] Populate include graph during static indexing action.

2018-11-30 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: unittests/clangd/IndexActionTests.cpp:168 + std::string MainFilePath = testPath("main.cpp"); + std::pair CommonHeader = {testPath("common.h"), + R"cpp(

[PATCH] D54999: [clangd] Populate include graph during static indexing action.

2018-11-29 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: unittests/clangd/IndexActionTests.cpp:168 + std::string MainFilePath = testPath("main.cpp"); + std::pair CommonHeader = {testPath("common.h"), + R"cpp(

[PATCH] D54999: [clangd] Populate include graph during static indexing action.

2018-11-29 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 175899. kadircet marked 4 inline comments as done. kadircet added a comment. - Address comments. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54999/new/ https://reviews.llvm.org/D54999 Files:

[PATCH] D54999: [clangd] Populate include graph during static indexing action.

2018-11-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/Headers.h:64 +// Important: The graph generated by those callbacks might contain cycles and +// self edges. using IncludeGraph = llvm::StringMap; And multi-edges too, right? Even though they're not useful.

[PATCH] D54999: [clangd] Populate include graph during static indexing action.

2018-11-29 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 175878. kadircet marked 8 inline comments as done. kadircet added a comment. - Address comments Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54999/new/ https://reviews.llvm.org/D54999 Files:

[PATCH] D54999: [clangd] Populate include graph during static indexing action.

2018-11-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/index/IndexAction.cpp:31 + // Populates the following fields of the corresponding node for a new include: + // - Digest -> SHA1 hash of the file. + // - IsTU -> true if the file is the main file the indexing action has

[PATCH] D54999: [clangd] Populate include graph during static indexing action.

2018-11-29 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: unittests/clangd/IndexActionTests.cpp:28 +std::string PathToURI(llvm::StringRef Path) { + return URI::create(Path).toString(); +} ilya-biryukov wrote: > Maybe inline this? This looks simple enough. yeah but repeating

[PATCH] D54999: [clangd] Populate include graph during static indexing action.

2018-11-29 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 175831. kadircet marked 17 inline comments as done. kadircet added a comment. - Address comments. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54999/new/ https://reviews.llvm.org/D54999 Files:

[PATCH] D54999: [clangd] Populate include graph during static indexing action.

2018-11-28 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/index/IndexAction.cpp:12 +llvm::Optional URIFromFileEntry(const FileEntry *File) { + if (!File) NIT: maybe call it `toURI`? Comment at: clangd/index/IndexAction.cpp:23 +// Collects the

[PATCH] D54999: [clangd] Populate include graph during static indexing action.

2018-11-28 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/index/IndexAction.cpp:45 +auto = I->getValue(); +if (auto Digest = digestFile(SM, FileID)) + Node.Digest = std::move(*Digest); kadircet wrote: > ilya-biryukov wrote: > > What happens if we

[PATCH] D54999: [clangd] Populate include graph during static indexing action.

2018-11-28 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 175684. kadircet marked 11 inline comments as done. kadircet added a comment. - Address comments. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54999/new/ https://reviews.llvm.org/D54999 Files:

[PATCH] D54999: [clangd] Populate include graph during static indexing action.

2018-11-28 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clangd/index/IndexAction.cpp:45 +auto = I->getValue(); +if (auto Digest = digestFile(SM, FileID)) + Node.Digest = std::move(*Digest); ilya-biryukov wrote: > What happens if we can't compute a digest for a

[PATCH] D54999: [clangd] Populate include graph during static indexing action.

2018-11-28 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/index/IndexAction.cpp:23 +// Collects the nodes and edges of include graph during indexing action. +struct IncludeGraphCollector : public PPCallbacks { +public: Could we add an assertion that the final

[PATCH] D54999: [clangd] Populate include graph during static indexing action.

2018-11-28 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. kadircet added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, arphaman, jkorous, MaskRay, ioeric, mgorny. This is the second part for introducing include hierarchy into index files produced by clangd. You can see the base patch that introduces