[clang-tools-extra] [clangd] Don't show inlay hints for __builtin_dump_struct (PR #71366)

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 13 23:41:11 PST 2023


HighCommander4 wrote:

I see; it's a bit unfortunate that such an "invented" call expression gets an ordinary `SourceLocation`. I would have hoped it gets a source location in some sort of virtual buffer like the [rewritten form of `>>`](https://github.com/clangd/clangd/issues/871#issuecomment-933178468), or macro expansions.

---

What do you think about the following idea: override the traversal of `PseudoObjectExpr`, but rather than traversing [both the `getSyntacticForm()` and the semantic expressions](https://searchfox.org/llvm/rev/40671bbdefb6ff83e2685576a3cb041b62f25bbe/clang/include/clang/AST/RecursiveASTVisitor.h#2573-2584), only traverse the `getSyntacticForm()`?

That leave the door open to a future enhancement where the arguments in the syntactic form (the `__builtin_dump_struct`) could get parameter hints, which might be useful for a reader to understand what the builtin does.

https://github.com/llvm/llvm-project/pull/71366


More information about the cfe-commits mailing list