[ProfileData] Actually fix Clang -Wcovered-switch-default after D109398

The Clang attribute `enum_extensibility(open)` (2017) is too new.
Just use a cast.
This commit is contained in:
Fangrui Song 2021-09-08 00:15:54 -07:00
parent 29d054bf12
commit 52f739c4ae
1 changed files with 3 additions and 2 deletions

View File

@ -132,7 +132,7 @@ enum SecType {
};
static inline std::string getSecName(SecType Type) {
switch (Type) {
switch ((int)Type) { // Avoid -Wcovered-switch-default
case SecInValid:
return "InvalidSection";
case SecProfSummary:
@ -149,8 +149,9 @@ static inline std::string getSecName(SecType Type) {
return "CSNameTableSection";
case SecLBRProfile:
return "LBRProfileSection";
default:
return "UnknownSection";
}
llvm_unreachable("");
}
// Entry type of section header table used by SampleProfileExtBinaryBaseReader