tom-anders added inline comments.

================
Comment at: clang-tools-extra/clangd/Hover.cpp:986
+  const FunctionDecl *FD = nullptr;
+  llvm::SmallVector<const Expr*> Args;
+
----------------
nridge wrote:
> 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`).
Ah perfect, thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147847

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to