Skip to content

Commit e595195

Browse files
committed
populate overloads use explicit types
#perf
1 parent 93d5d10 commit e595195

17 files changed

+262
-174
lines changed

include/mrdocs/Metadata/Info.hpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
#include <mrdocs/Metadata/Javadoc.hpp>
2121
#include <mrdocs/Metadata/Specifiers.hpp>
2222
#include <mrdocs/Metadata/Symbols.hpp>
23+
#include <mrdocs/Metadata/Source.hpp>
2324
#include <mrdocs/Platform.hpp>
2425
#include <mrdocs/Support/Visitor.hpp>
2526

27+
2628
namespace clang::mrdocs {
2729

2830
/* Forward declarations
@@ -59,8 +61,7 @@ tag_invoke(
5961

6062
/** Base class with common properties of all symbols
6163
*/
62-
struct MRDOCS_VISIBLE
63-
Info
64+
struct MRDOCS_VISIBLE Info : SourceInfo
6465
{
6566
/** The unique identifier for this symbol.
6667
*/

include/mrdocs/Metadata/Info/Concept.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ namespace clang::mrdocs {
2222
*/
2323
struct ConceptInfo final
2424
: InfoCommonBase<InfoKind::Concept>
25-
, SourceInfo
2625
{
2726
/** The concepts template parameters
2827
*/

include/mrdocs/Metadata/Info/Enum.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ namespace clang::mrdocs {
2222

2323
struct EnumInfo final
2424
: InfoCommonBase<InfoKind::Enum>
25-
, SourceInfo
2625
, ScopeInfo
2726
{
2827
// Indicates whether this enum is scoped (e.g. enum class).

include/mrdocs/Metadata/Info/EnumConstant.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ namespace clang::mrdocs {
2121
*/
2222
struct EnumConstantInfo final
2323
: InfoCommonBase<InfoKind::EnumConstant>
24-
, SourceInfo
2524
{
2625
/** The initializer expression, if any
2726
*/

include/mrdocs/Metadata/Info/Field.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ namespace clang::mrdocs {
2727
*/
2828
struct FieldInfo final
2929
: InfoCommonBase<InfoKind::Field>
30-
, SourceInfo
3130
{
3231
/** Type of the field */
3332
PolymorphicValue<TypeInfo> Type;

include/mrdocs/Metadata/Info/Friend.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ namespace clang::mrdocs {
2121
*/
2222
struct FriendInfo final
2323
: InfoCommonBase<InfoKind::Friend>
24-
, SourceInfo
2524
{
2625
/** Befriended symbol.
2726
*/

include/mrdocs/Metadata/Info/Function.hpp

+10-14
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ tag_invoke(
126126
// Info for functions.
127127
struct FunctionInfo final
128128
: InfoCommonBase<InfoKind::Function>
129-
, SourceInfo
130129
{
131130
/// Info about the return type of this function.
132131
PolymorphicValue<TypeInfo> ReturnType;
@@ -141,35 +140,32 @@ struct FunctionInfo final
141140
FunctionClass Class = FunctionClass::Normal;
142141

143142
NoexceptInfo Noexcept;
144-
145-
ExplicitInfo Explicit;
146-
147143
ExprInfo Requires;
148-
149144
bool IsVariadic = false;
150-
bool IsVirtual = false;
151-
bool IsVirtualAsWritten = false;
152-
bool IsPure = false;
153145
bool IsDefaulted = false;
154146
bool IsExplicitlyDefaulted = false;
155147
bool IsDeleted = false;
156148
bool IsDeletedAsWritten = false;
157149
bool IsNoReturn = false;
158150
bool HasOverrideAttr = false;
159151
bool HasTrailingReturn = false;
160-
bool IsConst = false;
161-
bool IsVolatile = false;
162-
bool IsFinal = false;
163152
bool IsNodiscard = false;
164153
bool IsExplicitObjectMemberFunction = false;
165-
166154
ConstexprKind Constexpr = ConstexprKind::None;
167155
OperatorKind OverloadedOperator = OperatorKind::None;
168156
StorageClassKind StorageClass = StorageClassKind::None;
169-
ReferenceKind RefQualifier = ReferenceKind::None;
170-
171157
std::vector<std::string> Attributes;
172158

159+
// CXXMethodDecl
160+
bool IsVirtual = false;
161+
bool IsVirtualAsWritten = false;
162+
bool IsPure = false;
163+
bool IsConst = false;
164+
bool IsVolatile = false;
165+
bool IsFinal = false;
166+
ReferenceKind RefQualifier = ReferenceKind::None;
167+
ExplicitInfo Explicit;
168+
173169
//--------------------------------------------
174170

175171
explicit FunctionInfo(SymbolID const& ID) noexcept

include/mrdocs/Metadata/Info/Guide.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ namespace clang::mrdocs {
2323
*/
2424
struct GuideInfo final
2525
: InfoCommonBase<InfoKind::Guide>
26-
, SourceInfo
2726
{
2827
/** The pattern for the deduced specialization.
2928

include/mrdocs/Metadata/Info/NamespaceAlias.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ namespace clang::mrdocs {
2020
*/
2121
struct NamespaceAliasInfo final
2222
: InfoCommonBase<InfoKind::NamespaceAlias>
23-
, SourceInfo
2423
{
2524
/** The aliased symbol. */
2625
PolymorphicValue<NameInfo> AliasedSymbol;

include/mrdocs/Metadata/Info/Record.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ tag_invoke(
7575
*/
7676
struct RecordInfo final
7777
: InfoCommonBase<InfoKind::Record>
78-
, SourceInfo
7978
, ScopeInfo
8079
{
8180
/** Kind of record this is (class, struct, or union).

include/mrdocs/Metadata/Info/Typedef.hpp

+12-5
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,21 @@ namespace clang::mrdocs {
2222
// Info for typedef and using statements.
2323
struct TypedefInfo final
2424
: InfoCommonBase<InfoKind::Typedef>
25-
, SourceInfo
2625
{
2726
PolymorphicValue<TypeInfo> Type;
2827

29-
// Indicates if this is a new C++ "using"-style typedef:
30-
// using MyVector = std::vector<int>
31-
// False means it's a C-style typedef:
32-
// typedef std::vector<int> MyVector;
28+
/** Indicates if this is a new C++ "using"-style typedef
29+
30+
@code
31+
using MyVector = std::vector<int>
32+
@endcode
33+
34+
False means it's a C-style typedef:
35+
36+
@code
37+
typedef std::vector<int> MyVector;
38+
@endcode
39+
*/
3340
bool IsUsing = false;
3441

3542
std::optional<TemplateInfo> Template;

include/mrdocs/Metadata/Info/Variable.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ namespace clang::mrdocs {
2626
*/
2727
struct VariableInfo final
2828
: InfoCommonBase<InfoKind::Variable>
29-
, SourceInfo
3029
{
3130
/** The type of the variable */
3231
PolymorphicValue<TypeInfo> Type;

include/mrdocs/Metadata/Source.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#include <mrdocs/Platform.hpp>
1717
#include <mrdocs/ADT/Optional.hpp>
18-
#include <mrdocs/Metadata/Info.hpp>
18+
#include <mrdocs/Dom.hpp>
1919
#include <string>
2020

2121
namespace clang::mrdocs {
@@ -118,7 +118,7 @@ struct MRDOCS_DECL
118118
*/
119119
OptionalLocation DefLoc;
120120

121-
/** Locations where the entity was declared,
121+
/** Locations where the entity was declared.
122122
123123
This does not include the definition.
124124
*/

include/mrdocs/Metadata/Using.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ tag_invoke(
5656
/** Info for using declarations.
5757
*/
5858
struct UsingInfo final
59-
: InfoCommonBase<InfoKind::Using>,
60-
SourceInfo
59+
: InfoCommonBase<InfoKind::Using>
6160
{
6261
/** The kind of using declaration.
6362
*/

0 commit comments

Comments
 (0)