Skip to content

Commit e9015a2

Browse files
committed
change InfoType to InfoKind
1 parent 8fe719a commit e9015a2

30 files changed

+158
-158
lines changed

include/mrdox/Corpus.hpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -161,19 +161,19 @@ get(
161161
assert(I != nullptr);
162162
auto const t = static_cast<T const*>(I);
163163
if constexpr(std::is_same_v<T, NamespaceInfo>)
164-
assert(t->IT == InfoType::IT_namespace);
164+
assert(t->Kind == InfoKind::Namespace);
165165
else if constexpr(std::is_same_v<T, RecordInfo>)
166-
assert(t->IT == InfoType::IT_record);
166+
assert(t->Kind == InfoKind::Record);
167167
else if constexpr(std::is_same_v<T, FunctionInfo>)
168-
assert(t->IT == InfoType::IT_function);
168+
assert(t->Kind == InfoKind::Function);
169169
else if constexpr(std::is_same_v<T, TypedefInfo>)
170-
assert(t->IT == InfoType::IT_typedef);
170+
assert(t->Kind == InfoKind::Typedef);
171171
else if constexpr(std::is_same_v<T, EnumInfo>)
172-
assert(t->IT == InfoType::IT_enum);
172+
assert(t->Kind == InfoKind::Enum);
173173
else if constexpr(std::is_same_v<T, VarInfo>)
174-
assert(t->IT == InfoType::IT_variable);
174+
assert(t->Kind == InfoKind::Variable);
175175
else if constexpr(std::is_same_v<T, FieldInfo>)
176-
assert(t->IT == InfoType::IT_field);
176+
assert(t->Kind == InfoKind::Field);
177177
return *t;
178178
}
179179

include/mrdox/Metadata/Enum.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ struct EnumInfo
8282

8383
//--------------------------------------------
8484

85-
static constexpr InfoType type_id = InfoType::IT_enum;
85+
static constexpr InfoKind kind_id = InfoKind::Enum;
8686

8787
explicit
8888
EnumInfo(
8989
SymbolID ID = SymbolID::zero)
90-
: SymbolInfo(InfoType::IT_enum, ID)
90+
: SymbolInfo(InfoKind::Enum, ID)
9191
{
9292
}
9393
};

include/mrdox/Metadata/Field.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ struct FieldInfo
5656

5757
//--------------------------------------------
5858

59-
static constexpr InfoType type_id = InfoType::IT_field;
59+
static constexpr InfoKind kind_id = InfoKind::Field;
6060

6161
FieldInfo(
6262
SymbolID ID = SymbolID::zero)
63-
: SymbolInfo(InfoType::IT_field, ID)
63+
: SymbolInfo(InfoKind::Field, ID)
6464
{
6565
}
6666
};

include/mrdox/Metadata/Function.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -190,20 +190,20 @@ struct FunctionInfo
190190

191191
//--------------------------------------------
192192

193-
static constexpr InfoType type_id = InfoType::IT_function;
193+
static constexpr InfoKind kind_id = InfoKind::Function;
194194

195195
explicit
196196
FunctionInfo(
197197
SymbolID ID = SymbolID::zero)
198-
: SymbolInfo(InfoType::IT_function, ID)
198+
: SymbolInfo(InfoKind::Function, ID)
199199
{
200200
}
201201

202202
private:
203203
explicit
204204
FunctionInfo(
205205
std::unique_ptr<TemplateInfo>&& T)
206-
: SymbolInfo(InfoType::IT_function)
206+
: SymbolInfo(InfoKind::Function)
207207
, Template(std::move(T))
208208
{
209209
}

include/mrdox/Metadata/Info.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct Info
3434

3535
/** Kind of declaration.
3636
*/
37-
InfoType IT = InfoType::IT_default;
37+
InfoKind Kind = InfoKind::Default;
3838

3939
/** The unqualified name.
4040
*/
@@ -56,10 +56,10 @@ struct Info
5656

5757
explicit
5858
Info(
59-
InfoType IT = InfoType::IT_default,
59+
InfoKind kind = InfoKind::Default,
6060
SymbolID ID = SymbolID::zero)
6161
: id(ID)
62-
, IT(IT)
62+
, Kind(kind)
6363
{
6464
}
6565

include/mrdox/Metadata/Namespace.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct NamespaceInfo
2828

2929
//--------------------------------------------
3030

31-
static constexpr InfoType type_id = InfoType::IT_namespace;
31+
static constexpr InfoKind kind_id = InfoKind::Namespace;
3232

3333
NamespaceInfo();
3434

include/mrdox/Metadata/Record.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -160,20 +160,20 @@ struct RecordInfo
160160

161161
//--------------------------------------------
162162

163-
static constexpr InfoType type_id = InfoType::IT_record;
163+
static constexpr InfoKind kind_id = InfoKind::Record;
164164

165165
explicit
166166
RecordInfo(
167167
SymbolID ID = SymbolID::zero)
168-
: SymbolInfo(InfoType::IT_record, ID)
168+
: SymbolInfo(InfoKind::Record, ID)
169169
{
170170
}
171171

172172
private:
173173
explicit
174174
RecordInfo(
175175
std::unique_ptr<TemplateInfo>&& T)
176-
: SymbolInfo(InfoType::IT_record)
176+
: SymbolInfo(InfoKind::Record)
177177
, Template(std::move(T))
178178
{
179179
}

include/mrdox/Metadata/Reference.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct Reference
3434

3535
/** The type of the referenced symbol.
3636
*/
37-
InfoType RefType = InfoType::IT_default;
37+
InfoKind RefKind = InfoKind::Default;
3838

3939
//--------------------------------------------
4040

@@ -46,10 +46,10 @@ struct Reference
4646
Reference(
4747
SymbolID ID = SymbolID::zero,
4848
std::string_view Name = "",
49-
InfoType IT = InfoType::IT_default)
49+
InfoKind kind = InfoKind::Default)
5050
: id(ID)
5151
, Name(Name)
52-
, RefType(IT)
52+
, RefKind(kind)
5353
{
5454
}
5555

@@ -62,8 +62,8 @@ struct Reference
6262
// VFALCO Is this function only needed
6363
// for the old unit tests?
6464
return
65-
std::tie(id, Name, RefType) ==
66-
std::tie(Other.id, Other.Name, Other.RefType);
65+
std::tie(id, Name, RefKind) ==
66+
std::tie(Other.id, Other.Name, Other.RefKind);
6767
}
6868
#endif
6969
};

include/mrdox/Metadata/Symbol.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ struct SymbolInfo
4545

4646
explicit
4747
SymbolInfo(
48-
InfoType IT,
48+
InfoKind kind,
4949
SymbolID ID = SymbolID::zero)
50-
: Info(IT, ID)
50+
: Info(kind, ID)
5151
{
5252
}
5353
};

include/mrdox/Metadata/Symbols.hpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,17 @@ using OptionalSymbolID = Optional<SymbolID>;
107107

108108
/** Info variant discriminator
109109
*/
110-
enum class InfoType
110+
enum class InfoKind
111111
{
112-
IT_default,
113-
IT_namespace,
114-
IT_record,
115-
IT_function,
116-
IT_enum,
117-
IT_typedef,
118-
IT_variable,
119-
IT_field,
120-
IT_specialization
112+
Default,
113+
Namespace,
114+
Record,
115+
Function,
116+
Enum,
117+
Typedef,
118+
Variable,
119+
Field,
120+
Specialization
121121
};
122122

123123
/** Return the result of comparing s0 to s1.

include/mrdox/Metadata/Type.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct TypeInfo
5151
TypeInfo(
5252
std::string_view Name)
5353
: Reference(
54-
SymbolID::zero, Name, InfoType::IT_default)
54+
SymbolID::zero, Name, InfoKind::Default)
5555
{
5656
}
5757

include/mrdox/Metadata/Typedef.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ struct TypedefInfo
4040

4141
//--------------------------------------------
4242

43-
static constexpr InfoType type_id = InfoType::IT_typedef;
43+
static constexpr InfoKind kind_id = InfoKind::Typedef;
4444

4545
explicit
4646
TypedefInfo(
4747
SymbolID id_ = SymbolID::zero)
48-
: SymbolInfo(InfoType::IT_typedef, id_)
48+
: SymbolInfo(InfoKind::Typedef, id_)
4949
{
5050
}
5151

@@ -55,7 +55,7 @@ struct TypedefInfo
5555
explicit
5656
TypedefInfo(
5757
std::unique_ptr<TemplateInfo>&& T)
58-
: SymbolInfo(InfoType::IT_typedef)
58+
: SymbolInfo(InfoKind::Typedef)
5959
, Template(std::move(T))
6060
{
6161
}

include/mrdox/Metadata/Var.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,20 @@ struct VarInfo
4949

5050
//--------------------------------------------
5151

52-
static constexpr InfoType type_id = InfoType::IT_variable;
52+
static constexpr InfoKind kind_id = InfoKind::Variable;
5353

5454
explicit
5555
VarInfo(
5656
SymbolID ID = SymbolID::zero)
57-
: SymbolInfo(InfoType::IT_variable, ID)
57+
: SymbolInfo(InfoKind::Variable, ID)
5858
{
5959
}
6060

6161
private:
6262
explicit
6363
VarInfo(
6464
std::unique_ptr<TemplateInfo>&& T)
65-
: SymbolInfo(InfoType::IT_variable)
65+
: SymbolInfo(InfoKind::Variable)
6666
, Template(std::move(T))
6767
{
6868

source/-XML/CXXTags.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ namespace xml {
1919
llvm::StringRef
2020
getTagName(Info const& I) noexcept
2121
{
22-
switch(I.IT)
22+
switch(I.Kind)
2323
{
24-
case InfoType::IT_namespace:
24+
case InfoKind::Namespace:
2525
return namespaceTagName;
26-
case InfoType::IT_record:
26+
case InfoKind::Record:
2727
switch(static_cast<RecordInfo const&>(I).KeyKind)
2828
{
2929
case RecordKeyKind::Class: return classTagName;
@@ -34,17 +34,17 @@ getTagName(Info const& I) noexcept
3434
break;
3535
}
3636
break;
37-
case InfoType::IT_function:
37+
case InfoKind::Function:
3838
return functionTagName;
39-
case InfoType::IT_typedef:
39+
case InfoKind::Typedef:
4040
if(static_cast<TypedefInfo const&>(I).IsUsing)
4141
return aliasTagName;
4242
else
4343
return typedefTagName;
4444
break;
45-
case InfoType::IT_enum:
45+
case InfoKind::Enum:
4646
return enumTagName;
47-
case InfoType::IT_variable:
47+
case InfoKind::Variable:
4848
return varTagName;
4949
default:
5050
break;

source/-XML/XMLTags.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct xmlEscape
6464

6565
// Converters for attributes
6666
std::string toString(SymbolID const& id);
67-
llvm::StringRef toString(InfoType) noexcept;
67+
llvm::StringRef toString(InfoKind) noexcept;
6868
llvm::StringRef toString(Javadoc::Style style) noexcept;
6969

7070
//------------------------------------------------

source/-adoc/AdocWriter.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -580,17 +580,17 @@ writeLocation(
580580
#endif
581581
//--------------------------------------------
582582

583-
switch(I.IT)
583+
switch(I.Kind)
584584
{
585585
default:
586-
case InfoType::IT_function:
586+
case InfoKind::Function:
587587
os_ <<
588588
"\n"
589589
"Declared in " << url <<
590590
"[" << loc->Filename << "]" <<
591591
"\n";
592592
break;
593-
case InfoType::IT_record:
593+
case InfoKind::Record:
594594
os_ <<
595595
"\n"
596596
"`#include <" << url <<

source/AST/ASTVisitor.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,16 @@ getTypeInfoForType(
195195
SymbolID id = SymbolID::zero;
196196
if(const TagDecl* TD = getTagDeclForType(T))
197197
{
198-
InfoType IT;
198+
InfoKind kind;
199199
if(isa<EnumDecl>(TD))
200-
IT = InfoType::IT_enum;
200+
kind = InfoKind::Enum;
201201
else if(isa<CXXRecordDecl>(TD))
202-
IT = InfoType::IT_record;
202+
kind = InfoKind::Record;
203203
else
204-
IT = InfoType::IT_default;
204+
kind = InfoKind::Default;
205205
extractSymbolID(TD, id);
206206
return TypeInfo(Reference(
207-
id, TD->getNameAsString(), IT));
207+
id, TD->getNameAsString(), kind));
208208
}
209209
return TypeInfo(Reference(id,
210210
getTypeAsString(T)));
@@ -481,7 +481,7 @@ writeParent(
481481
{
482482
NamespaceInfo P(I.Namespace.front());
483483
insertChild<Child>(P.Children,
484-
I.id, I.Name, Child::type_id);
484+
I.id, I.Name, Child::kind_id);
485485
return writeBitcode(P);
486486
}
487487
case AccessSpecifier::AS_public:

source/AST/AnyBlock.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ class ReferenceBlock
108108
return decodeRecord(R, I.id, Blob);
109109
case REFERENCE_NAME:
110110
return decodeRecord(R, I.Name, Blob);
111-
case REFERENCE_TYPE:
112-
return decodeRecord(R, I.RefType, Blob);
111+
case REFERENCE_KIND:
112+
return decodeRecord(R, I.RefKind, Blob);
113113
case REFERENCE_FIELD:
114114
return decodeRecord(R, F, Blob);
115115
default:

source/AST/BitcodeIDs.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ enum RecordID
113113
RECORD_KEY_KIND,
114114
REFERENCE_FIELD,
115115
REFERENCE_NAME,
116-
REFERENCE_TYPE,
116+
REFERENCE_KIND,
117117
REFERENCE_USR,
118118
RECORD_ENUMS,
119119
RECORD_FUNCTIONS,

0 commit comments

Comments
 (0)