[clang] [clang][CodeComplete] Use HeuristicResolver in getAsRecordDecl() (PR #130473)
Nathan Ridge via cfe-commits
cfe-commits at lists.llvm.org
Sun Mar 9 19:48:35 PDT 2025
HighCommander4 wrote:
I split the PR up into a few commits for easier reviewing.
The high-level idea here is that the helper function `getAsRecordDecl()` in SemaCodeComplete.cpp is doing similar things to HeuristicResolver (specifically, `simplifyType` and `resolveTypeToRecordDecl`), but HeuristicResolver is handling a few more cases, and to get code completion to benefit from those cases the patch gets the helper function to use HeuristicResolver.
There was one case, `TSK_Undeclared`, that `getAsRecordDecl()` handled but HeuristicResolver didn't. I contemplated adding a standalone test case for that to HeuristicResolverTests but it's not easy because the situation only arises during code completion when the AST is not fully built. The case does have test coverage, in `clang/test/CodeCompletion/desig-init.cpp` (this test fails without the `TSK_Undeclared` handling).
https://github.com/llvm/llvm-project/pull/130473
More information about the cfe-commits
mailing list