Skip to content

Commit dd8902a

Browse files
committed
[llvm-cov] Properly fix -Wcovered-switch-default in CoverageMapping.cpp
And revert commit 1f3fa96.
1 parent 6876514 commit dd8902a

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

llvm/lib/ProfileData/Coverage/CoverageMapping.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -964,33 +964,31 @@ static std::string getCoverageMapErrString(coveragemap_error Err,
964964
std::string Msg;
965965
raw_string_ostream OS(Msg);
966966

967-
switch ((uint32_t)Err) {
968-
case (uint32_t)coveragemap_error::success:
967+
switch (Err) {
968+
case coveragemap_error::success:
969969
OS << "success";
970970
break;
971-
case (uint32_t)coveragemap_error::eof:
971+
case coveragemap_error::eof:
972972
OS << "end of File";
973973
break;
974-
case (uint32_t)coveragemap_error::no_data_found:
974+
case coveragemap_error::no_data_found:
975975
OS << "no coverage data found";
976976
break;
977-
case (uint32_t)coveragemap_error::unsupported_version:
977+
case coveragemap_error::unsupported_version:
978978
OS << "unsupported coverage format version";
979979
break;
980-
case (uint32_t)coveragemap_error::truncated:
980+
case coveragemap_error::truncated:
981981
OS << "truncated coverage data";
982982
break;
983-
case (uint32_t)coveragemap_error::malformed:
983+
case coveragemap_error::malformed:
984984
OS << "malformed coverage data";
985985
break;
986-
case (uint32_t)coveragemap_error::decompression_failed:
986+
case coveragemap_error::decompression_failed:
987987
OS << "failed to decompress coverage data (zlib)";
988988
break;
989-
case (uint32_t)coveragemap_error::invalid_or_missing_arch_specifier:
989+
case coveragemap_error::invalid_or_missing_arch_specifier:
990990
OS << "`-arch` specifier is invalid or missing for universal binary";
991991
break;
992-
default:
993-
llvm_unreachable("invalid coverage mapping error.");
994992
}
995993

996994
// If optional error message is not empty, append it to the message.

0 commit comments

Comments
 (0)