Skip to content

Commit 23c943f

Browse files
OSS-Fuzz Teamcopybara-github
authored andcommitted
Updates LLVM usage to match [cb2f0d0a5f14](llvm/llvm-project@cb2f0d0a5f14) Indexer-PiperOrigin-RevId: 802610159
1 parent 14cab84 commit 23c943f

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

infra/indexer/frontend/ast_visitor.cc

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,12 +1461,6 @@ void AstVisitor::AddTypeReferencesFromLocation(LocationId location_id,
14611461
type = pointee_type;
14621462
}
14631463

1464-
// Then strip sugar (`struct` keyword, name qualifications, etc.)
1465-
while (llvm::isa<clang::ElaboratedType>(type)) {
1466-
const auto* elaborated_type = llvm::cast<clang::ElaboratedType>(type);
1467-
type = elaborated_type->desugar().getTypePtrOrNull();
1468-
}
1469-
14701464
if (llvm::isa<clang::TemplateSpecializationType>(type)) {
14711465
auto* specialization_type =
14721466
llvm::cast<clang::TemplateSpecializationType>(type);
@@ -1635,7 +1629,10 @@ void AstVisitor::AddReferencesForExpr(const clang::Expr* expr) {
16351629
if (decl && llvm::isa<clang::CXXMethodDecl>(decl)) {
16361630
const auto* method_decl = llvm::cast<clang::CXXMethodDecl>(decl);
16371631
if (method_decl->getParent()) {
1638-
const auto* type = method_decl->getParent()->getTypeForDecl();
1632+
const auto* type = method_decl->getParent()
1633+
->getASTContext()
1634+
.getCanonicalTagType(method_decl->getParent())
1635+
.getTypePtr();
16391636
if (type) {
16401637
AddTypeReferencesForSourceRange(expr->getSourceRange(), type);
16411638
}
@@ -1648,7 +1645,11 @@ void AstVisitor::AddReferencesForExpr(const clang::Expr* expr) {
16481645
const auto* constructor_decl =
16491646
llvm::cast<clang::CXXConstructorDecl>(decl);
16501647
if (constructor_decl->getParent()) {
1651-
const auto* type = constructor_decl->getParent()->getTypeForDecl();
1648+
const auto* type =
1649+
constructor_decl->getParent()
1650+
->getASTContext()
1651+
.getCanonicalTagType(constructor_decl->getParent())
1652+
.getTypePtr();
16521653
if (type) {
16531654
AddTypeReferencesForSourceRange(expr->getSourceRange(), type);
16541655
}

0 commit comments

Comments
 (0)