Skip to content

Commit bcf02e8

Browse files
committed
remove InfoKind::Default
1 parent 3205784 commit bcf02e8

File tree

5 files changed

+4
-16
lines changed

5 files changed

+4
-16
lines changed

include/mrdox/Metadata/Info.hpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct MRDOX_VISIBLE
3535

3636
/** Kind of declaration.
3737
*/
38-
InfoKind Kind = InfoKind::Default;
38+
InfoKind Kind;
3939

4040
/** The unqualified name.
4141
*/
@@ -57,7 +57,7 @@ struct MRDOX_VISIBLE
5757

5858
explicit
5959
Info(
60-
InfoKind kind = InfoKind::Default,
60+
InfoKind kind,
6161
SymbolID ID = SymbolID::zero)
6262
: id(ID)
6363
, Kind(kind)
@@ -80,7 +80,6 @@ struct MRDOX_VISIBLE
8080
std::string_view
8181
symbolType() const noexcept;
8282

83-
constexpr bool isDefault() const noexcept { return Kind == InfoKind::Default; }
8483
constexpr bool isNamespace() const noexcept { return Kind == InfoKind::Namespace; }
8584
constexpr bool isRecord() const noexcept { return Kind == InfoKind::Record; }
8685
constexpr bool isFunction() const noexcept { return Kind == InfoKind::Function; }
@@ -106,7 +105,6 @@ struct IsInfo : Info
106105
*/
107106
static constexpr InfoKind kind_id = K;
108107

109-
static constexpr bool isDefault() noexcept { return K== InfoKind::Default; }
110108
static constexpr bool isNamespace() noexcept { return K == InfoKind::Namespace; }
111109
static constexpr bool isRecord() noexcept { return K == InfoKind::Record; }
112110
static constexpr bool isFunction() noexcept { return K == InfoKind::Function; }

include/mrdox/Metadata/Symbols.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ using OptionalSymbolID = Optional<SymbolID>;
109109
*/
110110
enum class InfoKind
111111
{
112-
Default,
113112
Namespace,
114113
Record,
115114
Function,

source/AST/DecodeRecord.hpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ decodeRecord(
163163
InfoKind& Kind,
164164
llvm::StringRef Blob)
165165
{
166-
switch(auto kind = static_cast<InfoKind>(R[0]))
166+
Kind = static_cast<InfoKind>(R[0]);
167+
switch(Kind)
167168
{
168169
case InfoKind::Namespace:
169170
case InfoKind::Record:
@@ -173,10 +174,8 @@ decodeRecord(
173174
case InfoKind::Variable:
174175
case InfoKind::Field:
175176
case InfoKind::Specialization:
176-
Kind = kind;
177177
return Error::success();
178178
default:
179-
Kind = InfoKind::Default;
180179
return Error("InfoKind is invalid");
181180
}
182181
}

source/Metadata/Info.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ extractName() const
6060
case InfoKind::Variable:
6161
return std::string("@nonymous_var_") +
6262
llvm::toHex(id);
63-
case InfoKind::Default:
64-
return std::string("@nonymous_") +
65-
llvm::toHex(id);
6663
default:
6764
llvm_unreachable("Invalid InfoKind.");
6865
return std::string("");
@@ -94,8 +91,6 @@ symbolType() const noexcept
9491
{
9592
switch(this->Kind)
9693
{
97-
case InfoKind::Default:
98-
return "default";
9994
case InfoKind::Namespace:
10095
return "namespace";
10196
case InfoKind::Record:

source/Support/Debug.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,6 @@ format(
160160
const char* str = "<unknown InfoKind>";
161161
switch(t)
162162
{
163-
case clang::mrdox::InfoKind::Default:
164-
str = "default";
165-
break;
166163
case clang::mrdox::InfoKind::Namespace:
167164
str = "namespace";
168165
break;

0 commit comments

Comments
 (0)