@@ -531,10 +531,24 @@ void
531
531
ASTVisitor::
532
532
populate (Info& I, bool const isNew, DeclTy const * D)
533
533
{
534
- // Populate the documentation
535
- bool const isDocumented = generateJavadoc (I. javadoc , D);
534
+ populate (I. javadoc , D);
535
+ populate ( dynamic_cast <SourceInfo&>(I) , D);
536
536
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
+ {
538
552
clang::SourceLocation Loc = D->getBeginLoc ();
539
553
if (Loc.isInvalid ())
540
554
{
@@ -544,17 +558,26 @@ populate(Info& I, bool const isNew, DeclTy const* D)
544
558
{
545
559
populate (
546
560
dynamic_cast <SourceInfo&>(I),
547
- Loc, isDefinition (D), isDocumented);
561
+ Loc,
562
+ isDefinition (D),
563
+ D->getASTContext ().getRawCommentForDeclNoCache (D));
548
564
}
565
+ }
549
566
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 ;
558
581
}
559
582
560
583
void
@@ -686,6 +709,13 @@ populate(RecordInfo& I, ClassTemplateSpecializationDecl const* D)
686
709
populate (I, cast<CXXRecordDecl>(D));
687
710
}
688
711
712
+ void
713
+ ASTVisitor::
714
+ populate (RecordInfo& I, ClassTemplatePartialSpecializationDecl const * D)
715
+ {
716
+ populate (I, dynamic_cast <ClassTemplateSpecializationDecl const *>(D));
717
+ }
718
+
689
719
void
690
720
ASTVisitor::
691
721
populate (
@@ -1023,6 +1053,13 @@ populate(VariableInfo& I, VarTemplateSpecializationDecl const* D)
1023
1053
populate (I, cast<VarDecl>(D));
1024
1054
}
1025
1055
1056
+ void
1057
+ ASTVisitor::
1058
+ populate (VariableInfo& I, VarTemplatePartialSpecializationDecl const * D)
1059
+ {
1060
+ populate (I, dynamic_cast <VarTemplateSpecializationDecl const *>(D));
1061
+ }
1062
+
1026
1063
void
1027
1064
ASTVisitor::
1028
1065
populate (
@@ -1883,22 +1920,6 @@ qualifiedName(NamedDecl const* ND) const
1883
1920
return name;
1884
1921
}
1885
1922
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
-
1902
1923
Polymorphic<TypeInfo>
1903
1924
ASTVisitor::
1904
1925
toTypeInfo (QualType const qt, TraversalMode const mode)
0 commit comments