usaxena95 updated this revision to Diff 430657. usaxena95 marked 2 inline comments as done. usaxena95 added a comment.
Addressed comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125925/new/ https://reviews.llvm.org/D125925 Files: clang-tools-extra/clangd/XRefs.cpp clang-tools-extra/clangd/index/Index.h clang-tools-extra/clangd/index/remote/Index.proto clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp Index: clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp =================================================================== --- clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp +++ clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp @@ -122,6 +122,7 @@ Req.Filter = clangd::RefKind::All; if (Message->limit()) Req.Limit = Message->limit(); + Req.WantContainer = Message->want_container(); return Req; } @@ -239,6 +240,7 @@ RPCRequest.set_filter(static_cast<uint32_t>(From.Filter)); if (From.Limit) RPCRequest.set_limit(*From.Limit); + RPCRequest.set_want_container(From.WantContainer); return RPCRequest; } Index: clang-tools-extra/clangd/index/remote/Index.proto =================================================================== --- clang-tools-extra/clangd/index/remote/Index.proto +++ clang-tools-extra/clangd/index/remote/Index.proto @@ -47,6 +47,7 @@ repeated string ids = 1; optional uint32 filter = 2; optional uint32 limit = 3; + optional bool want_container = 4; } // The response is a stream of reference messages, and one terminating has_more Index: clang-tools-extra/clangd/index/Index.h =================================================================== --- clang-tools-extra/clangd/index/Index.h +++ clang-tools-extra/clangd/index/Index.h @@ -72,6 +72,9 @@ /// choose to return less than this, e.g. it tries to avoid returning stale /// results. llvm::Optional<uint32_t> Limit; + /// If set, populates the container of the reference. + /// Index implementations may chose to populate containers no matter what. + bool WantContainer = false; }; struct RelationsRequest { Index: clang-tools-extra/clangd/XRefs.cpp =================================================================== --- clang-tools-extra/clangd/XRefs.cpp +++ clang-tools-extra/clangd/XRefs.cpp @@ -2112,6 +2112,7 @@ // FIXME: Consider also using AST information when feasible. RefsRequest Request; Request.IDs.insert(*ID); + Request.WantContainer = true; // We could restrict more specifically to calls by introducing a new RefKind, // but non-call references (such as address-of-function) can still be // interesting as they can indicate indirect calls.
Index: clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp =================================================================== --- clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp +++ clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp @@ -122,6 +122,7 @@ Req.Filter = clangd::RefKind::All; if (Message->limit()) Req.Limit = Message->limit(); + Req.WantContainer = Message->want_container(); return Req; } @@ -239,6 +240,7 @@ RPCRequest.set_filter(static_cast<uint32_t>(From.Filter)); if (From.Limit) RPCRequest.set_limit(*From.Limit); + RPCRequest.set_want_container(From.WantContainer); return RPCRequest; } Index: clang-tools-extra/clangd/index/remote/Index.proto =================================================================== --- clang-tools-extra/clangd/index/remote/Index.proto +++ clang-tools-extra/clangd/index/remote/Index.proto @@ -47,6 +47,7 @@ repeated string ids = 1; optional uint32 filter = 2; optional uint32 limit = 3; + optional bool want_container = 4; } // The response is a stream of reference messages, and one terminating has_more Index: clang-tools-extra/clangd/index/Index.h =================================================================== --- clang-tools-extra/clangd/index/Index.h +++ clang-tools-extra/clangd/index/Index.h @@ -72,6 +72,9 @@ /// choose to return less than this, e.g. it tries to avoid returning stale /// results. llvm::Optional<uint32_t> Limit; + /// If set, populates the container of the reference. + /// Index implementations may chose to populate containers no matter what. + bool WantContainer = false; }; struct RelationsRequest { Index: clang-tools-extra/clangd/XRefs.cpp =================================================================== --- clang-tools-extra/clangd/XRefs.cpp +++ clang-tools-extra/clangd/XRefs.cpp @@ -2112,6 +2112,7 @@ // FIXME: Consider also using AST information when feasible. RefsRequest Request; Request.IDs.insert(*ID); + Request.WantContainer = true; // We could restrict more specifically to calls by introducing a new RefKind, // but non-call references (such as address-of-function) can still be // interesting as they can indicate indirect calls.
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits