@@ -89,8 +89,12 @@ template <typename T> static std::string serialize(T& I) {
89
89
return Buffer.str ().str ();
90
90
}
91
91
92
- std::string serialize (std::unique_ptr<Info>& I) {
93
- switch (I->IT ) {
92
+ std::string
93
+ serialize (
94
+ std::unique_ptr<Info>& I)
95
+ {
96
+ switch (I->IT )
97
+ {
94
98
case InfoType::IT_namespace:
95
99
return serialize (*static_cast <NamespaceInfo*>(I.get ()));
96
100
case InfoType::IT_record:
@@ -99,12 +103,17 @@ std::string serialize(std::unique_ptr<Info>& I) {
99
103
return serialize (*static_cast <EnumInfo*>(I.get ()));
100
104
case InfoType::IT_function:
101
105
return serialize (*static_cast <FunctionInfo*>(I.get ()));
106
+ // case InfoType::IT_typedef:
107
+ // return serialize(*static_cast<TypedefInfo*>(I.get()));
102
108
default :
103
109
return " " ;
104
110
}
105
111
}
106
112
107
- static SymbolID getUSRForDecl (const Decl* D) {
113
+ static
114
+ SymbolID
115
+ getUSRForDecl (
116
+ Decl const * D){
108
117
llvm::SmallString<128 > USR;
109
118
if (index::generateUSRForDecl (D, USR))
110
119
return SymbolID ();
@@ -420,18 +429,36 @@ void PopulateTemplateParameters(std::optional<TemplateInfo>& TemplateInfo,
420
429
}
421
430
}
422
431
423
- template <typename T>
424
- static void populateInfo (Info& I, const T* D, const FullComment* C,
425
- bool & IsInAnonymousNamespace) {
432
+ // ------------------------------------------------
433
+
434
+ template <typename T>
435
+ static
436
+ void
437
+ populateInfo (
438
+ Info& I,
439
+ T const * D,
440
+ FullComment const * C,
441
+ bool & IsInAnonymousNamespace)
442
+ {
426
443
I.USR = getUSRForDecl (D);
427
444
I.Name = D->getNameAsString ();
428
- populateParentNamespaces (I.Namespace , D, IsInAnonymousNamespace);
429
- if (C) {
445
+ populateParentNamespaces (
446
+ I.Namespace ,
447
+ D,
448
+ IsInAnonymousNamespace);
449
+ if (C)
450
+ {
430
451
I.Description .emplace_back ();
431
- parseComment (C, D->getASTContext (), I.javadoc , I.Description .back ());
452
+ parseComment (
453
+ C,
454
+ D->getASTContext (),
455
+ I.javadoc ,
456
+ I.Description .back ());
432
457
}
433
458
}
434
459
460
+ // ------------------------------------------------
461
+
435
462
template <typename T>
436
463
static void populateSymbolInfo (SymbolInfo& I, const T* D, const FullComment* C,
437
464
int LineNumber, StringRef Filename,
@@ -734,14 +761,17 @@ emitInfo(
734
761
return { nullptr , MakeAndInsertIntoParent<TypedefInfo&&>(std::move (Info)) };
735
762
}
736
763
737
- // A type alias is a C++ "using" declaration for a type. It gets mapped to a
738
- // TypedefInfo with the IsUsing flag set.
764
+ // ------------------------------------------------
765
+
766
+ // A type alias is a C++ "using" declaration for a
767
+ // type. It gets mapped to a TypedefInfo with the
768
+ // IsUsing flag set.
739
769
std::pair<
740
770
std::unique_ptr<Info>,
741
771
std::unique_ptr<Info>>
742
772
emitInfo (
743
- const TypeAliasDecl* D,
744
- const FullComment* FC,
773
+ TypeAliasDecl const * D,
774
+ FullComment const * FC,
745
775
int LineNumber,
746
776
StringRef File,
747
777
bool IsFileInRootDir,
0 commit comments