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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to