File tree 4 files changed +30
-16
lines changed
4 files changed +30
-16
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,12 @@ namespace mrdox {
21
21
// A base struct for TypeInfos
22
22
struct TypeInfo
23
23
{
24
+ /* * The type being referenced.
25
+ */
26
+ Reference Type;
27
+
28
+ // --------------------------------------------
29
+
24
30
TypeInfo () = default ;
25
31
26
32
explicit
@@ -44,8 +50,6 @@ struct TypeInfo
44
50
{
45
51
return Type == Other.Type ;
46
52
}
47
-
48
- Reference Type; // Referenced type in this info.
49
53
};
50
54
51
55
} // mrdox
Original file line number Diff line number Diff line change @@ -22,6 +22,16 @@ namespace mrdox {
22
22
// Info for typedef and using statements.
23
23
struct TypedefInfo : SymbolInfo
24
24
{
25
+ TypeInfo Underlying;
26
+
27
+ // Indicates if this is a new C++ "using"-style typedef:
28
+ // using MyVector = std::vector<int>
29
+ // False means it's a C-style typedef:
30
+ // typedef std::vector<int> MyVector;
31
+ bool IsUsing = false ;
32
+
33
+ // --------------------------------------------
34
+
25
35
static constexpr InfoType type_id = InfoType::IT_typedef;
26
36
27
37
TypedefInfo (
@@ -31,14 +41,6 @@ struct TypedefInfo : SymbolInfo
31
41
}
32
42
33
43
void merge (TypedefInfo&& I);
34
-
35
- TypeInfo Underlying;
36
-
37
- // Inidicates if this is a new C++ "using"-style typedef:
38
- // using MyVector = std::vector<int>
39
- // False means it's a C-style typedef:
40
- // typedef std::vector<int> MyVector;
41
- bool IsUsing = false ;
42
44
};
43
45
44
46
} // mrdox
Original file line number Diff line number Diff line change @@ -342,18 +342,24 @@ visit(
342
342
if (fd_os_ && fd_os_->error ())
343
343
return false ;
344
344
345
- tags_.open (" typedef" , {
345
+ llvm::StringRef tag;
346
+ if (I.IsUsing )
347
+ tag = " using" ;
348
+ else
349
+ tag = " typedef" ;
350
+ tags_.open (tag, {
346
351
{ " name" , I.Name },
347
352
{ I.id }
348
353
});
349
354
350
355
writeInfo (I);
351
356
writeSymbol (I);
352
- if (I.Underlying .Type .id != EmptySID)
353
- tags_.write (" qualusr" , toBase64 (I.Underlying .Type .id ));
357
+ tags_.write (" type" , " " , {
358
+ { " name" , I.Underlying .Type .Name },
359
+ { I.Underlying .Type .id } });
354
360
writeJavadoc (I.javadoc );
355
361
356
- tags_.close (" typedef " );
362
+ tags_.close (tag );
357
363
358
364
return true ;
359
365
}
Original file line number Diff line number Diff line change 61
61
</para >
62
62
</doc >
63
63
</function >
64
- <typedef name =" U1" id =" 6UtddyCJy89K/bZpTmDb5jVXwAY=" >
64
+ <using name =" U1" id =" 6UtddyCJy89K/bZpTmDb5jVXwAY=" >
65
65
<file path =" record-1.cpp" line =" 3" class =" def" />
66
- </typedef >
66
+ <type name =" int" />
67
+ </using >
67
68
<typedef name =" U2" id =" wwp4SQjMPktMmsnvq1thxjxFHFs=" >
68
69
<file path =" record-1.cpp" line =" 4" class =" def" />
70
+ <type name =" char" />
69
71
</typedef >
70
72
</struct >
71
73
</namespace >
You can’t perform that action at this time.
0 commit comments