Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/clangd/HeuristicResolver.cpp | ||
---|---|---|
38 | I wanted to call out the change on this line which is easy to overlook due to the code move: We were previously calling TypeDecl::getTypeForDecl(), but that's actually a low-level accessor for a cached value. The function that also populates the value if needed is ASTContext::getTypeDeclType(), hence I switch to using that. |
clang-tools-extra/clangd/HeuristicResolver.cpp | ||
---|---|---|
33 | the reason to promote this utility function to a class method seems to be able to access the member field ASTContext. If so, I'd probably just passing the ASTContext as a parameter rather then making them member methods. | |
38 | thanks for the highlight, I think this change makes sense. | |
60 | Is the resolveDeclsToType call necessary here? |
Address review comments
clang-tools-extra/clangd/HeuristicResolver.cpp | ||
---|---|---|
60 | The Decl returned by resolveDependentNameType() in this testcase is a TypeAliasDecl. The function needs to return the CXXRecordDecl which is named by the target type of the alias. We could add logic to "desugar" the TypeAliasDecl, but it seems easier to reuse the existing logic that does the desugaring in type-land. |
the reason to promote this utility function to a class method seems to be able to access the member field ASTContext. If so, I'd probably just passing the ASTContext as a parameter rather then making them member methods.