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
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:
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);
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:
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(
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(
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:
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.
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:
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
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
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:
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
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
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:
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
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
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
18 matches
Mail list logo