Skip to content

Commit

Permalink
[ProfileData] Actually fix Clang -Wcovered-switch-default after D109398
Browse files Browse the repository at this point in the history
The Clang attribute `enum_extensibility(open)` (2017) is too new.
Just use a cast.
  • Loading branch information
MaskRay committed Sep 8, 2021
1 parent 29d054b commit 52f739c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions llvm/include/llvm/ProfileData/SampleProf.h
Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 52f739c

Please sign in to comment.