@@ -531,10 +531,24 @@ void
531531ASTVisitor::
532532populate (Info& I, bool const isNew, DeclTy const * D)
533533{
534- // Populate the documentation
535- bool const isDocumented = generateJavadoc (I. javadoc , D);
534+ populate (I. javadoc , D);
535+ populate ( dynamic_cast <SourceInfo&>(I) , D);
536536
537- // Populate the source info
537+ // All other information is redundant if the symbol is not new
538+ MRDOCS_CHECK_OR (isNew);
539+
540+ // These should already have been populated by traverseImpl
541+ MRDOCS_ASSERT (I.id );
542+ MRDOCS_ASSERT (I.Kind != InfoKind::None);
543+
544+ I.Name = extractName (D);
545+ }
546+
547+ template <std::derived_from<Decl> DeclTy>
548+ void
549+ ASTVisitor::
550+ populate (SourceInfo& I, DeclTy const * D)
551+ {
538552 clang::SourceLocation Loc = D->getBeginLoc ();
539553 if (Loc.isInvalid ())
540554 {
@@ -544,17 +558,26 @@ populate(Info& I, bool const isNew, DeclTy const* D)
544558 {
545559 populate (
546560 dynamic_cast <SourceInfo&>(I),
547- Loc, isDefinition (D), isDocumented);
561+ Loc,
562+ isDefinition (D),
563+ D->getASTContext ().getRawCommentForDeclNoCache (D));
548564 }
565+ }
549566
550- // All other information is redundant if the symbol is not new
551- MRDOCS_CHECK_OR (isNew);
552-
553- // These should already have been populated by traverseImpl
554- MRDOCS_ASSERT (I.id );
555- MRDOCS_ASSERT (I.Kind != InfoKind::None);
556-
557- I.Name = extractName (D);
567+ bool
568+ ASTVisitor::
569+ populate (
570+ std::optional<Javadoc>& javadoc,
571+ Decl const * D)
572+ {
573+ RawComment const * RC =
574+ D->getASTContext ().getRawCommentForDeclNoCache (D);
575+ MRDOCS_CHECK_OR (RC, false );
576+ comments::FullComment* FC =
577+ RC->parse (D->getASTContext (), &sema_.getPreprocessor (), D);
578+ MRDOCS_CHECK_OR (FC, false );
579+ parseJavadoc (javadoc, FC, D, config_, diags_);
580+ return true ;
558581}
559582
560583void
@@ -686,6 +709,13 @@ populate(RecordInfo& I, ClassTemplateSpecializationDecl const* D)
686709 populate (I, cast<CXXRecordDecl>(D));
687710}
688711
712+ void
713+ ASTVisitor::
714+ populate (RecordInfo& I, ClassTemplatePartialSpecializationDecl const * D)
715+ {
716+ populate (I, dynamic_cast <ClassTemplateSpecializationDecl const *>(D));
717+ }
718+
689719void
690720ASTVisitor::
691721populate (
@@ -1023,6 +1053,13 @@ populate(VariableInfo& I, VarTemplateSpecializationDecl const* D)
10231053 populate (I, cast<VarDecl>(D));
10241054}
10251055
1056+ void
1057+ ASTVisitor::
1058+ populate (VariableInfo& I, VarTemplatePartialSpecializationDecl const * D)
1059+ {
1060+ populate (I, dynamic_cast <VarTemplateSpecializationDecl const *>(D));
1061+ }
1062+
10261063void
10271064ASTVisitor::
10281065populate (
@@ -1883,22 +1920,6 @@ qualifiedName(NamedDecl const* ND) const
18831920 return name;
18841921}
18851922
1886- bool
1887- ASTVisitor::
1888- generateJavadoc (
1889- std::optional<Javadoc>& javadoc,
1890- Decl const * D)
1891- {
1892- RawComment const * RC =
1893- D->getASTContext ().getRawCommentForDeclNoCache (D);
1894- MRDOCS_CHECK_OR (RC, false );
1895- comments::FullComment* FC =
1896- RC->parse (D->getASTContext (), &sema_.getPreprocessor (), D);
1897- MRDOCS_CHECK_OR (FC, false );
1898- parseJavadoc (javadoc, FC, D, config_, diags_);
1899- return true ;
1900- }
1901-
19021923Polymorphic<TypeInfo>
19031924ASTVisitor::
19041925toTypeInfo (QualType const qt, TraversalMode const mode)
0 commit comments