[PATCH] D147847: [clangd] Hover: Add CalleeArgInfo for constructor expressions

Nathan Ridge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 17 00:04:59 PDT 2023


nridge added inline comments.


================
Comment at: clang-tools-extra/clangd/Hover.cpp:986
+  const FunctionDecl *FD = nullptr;
+  llvm::SmallVector<const Expr*> Args;
+
----------------
tom-anders wrote:
> 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?
You can use `ArrayRef` instead of `SmallVector` and avoid copying the arguments (compare [process_call](https://searchfox.org/llvm/rev/b34ca0851a5209a10c0ca285c000a18073677891/clang-tools-extra/clangd/InlayHints.cpp#239,265) in `InlayHintVisitor`).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147847/new/

https://reviews.llvm.org/D147847



More information about the cfe-commits mailing list