Skip to content

Unify getPrototypeLoc functions in InlayHints.cpp and SemaCodeComplete.cpp #143240

@HighCommander4

Description

@HighCommander4

We have two almost-identical utility functions, getPrototypeLoc() in clang-tools-extra/clangd/InlayHints.cpp and GetPrototypeLoc() in clang/lib/Sema/SemaCodeComplete.cpp.

To avoid code duplication and divergence in behaviour, we should unify them.

I think HeuristicResolver is a good place for a common implementation, as it fits the profile of what these functions are doing (trying to recover a FunctionProtoTypeLoc from a call expression on a best-effort basis).

Metadata

Metadata

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions