This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Hover: Add CalleeArgInfo for constructor expressions
ClosedPublic

Authored by tom-anders on Apr 8 2023, 3:59 AM.

Diff Detail

Event Timeline

tom-anders created this revision.Apr 8 2023, 3:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 8 2023, 3:59 AM
tom-anders requested review of this revision.Apr 8 2023, 3:59 AM
tom-anders added inline comments.Apr 8 2023, 4:02 AM
clang-tools-extra/clangd/Hover.cpp
986

Unfortunately, while CallExpr and CXXConstructExpr basically have the same API for getting Args, they're not related by a common base class.

Is there a more elegant solution than temporarily storing the Args in a SmallVector here?

(Note that this diff is stacked on D147846)

nridge added inline comments.Apr 17 2023, 12:04 AM
clang-tools-extra/clangd/Hover.cpp
986

You can use ArrayRef instead of SmallVector and avoid copying the arguments (compare process_call in InlayHintVisitor).

tom-anders marked an inline comment as done.

Use ArrayRef instead of SmallVector to avoid copy (also fix 2 typos in the comment below)

clang-tools-extra/clangd/Hover.cpp
986

Ah perfect, thanks!

nridge accepted this revision.Apr 28 2023, 4:31 PM

LGTM

This revision is now accepted and ready to land.Apr 28 2023, 4:31 PM