diff --git a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp index f8466bc8f7eb8..4a3244d120875 100644 --- a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp +++ b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp @@ -964,33 +964,31 @@ static std::string getCoverageMapErrString(coveragemap_error Err, std::string Msg; raw_string_ostream OS(Msg); - switch ((uint32_t)Err) { - case (uint32_t)coveragemap_error::success: + switch (Err) { + case coveragemap_error::success: OS << "success"; break; - case (uint32_t)coveragemap_error::eof: + case coveragemap_error::eof: OS << "end of File"; break; - case (uint32_t)coveragemap_error::no_data_found: + case coveragemap_error::no_data_found: OS << "no coverage data found"; break; - case (uint32_t)coveragemap_error::unsupported_version: + case coveragemap_error::unsupported_version: OS << "unsupported coverage format version"; break; - case (uint32_t)coveragemap_error::truncated: + case coveragemap_error::truncated: OS << "truncated coverage data"; break; - case (uint32_t)coveragemap_error::malformed: + case coveragemap_error::malformed: OS << "malformed coverage data"; break; - case (uint32_t)coveragemap_error::decompression_failed: + case coveragemap_error::decompression_failed: OS << "failed to decompress coverage data (zlib)"; break; - case (uint32_t)coveragemap_error::invalid_or_missing_arch_specifier: + case coveragemap_error::invalid_or_missing_arch_specifier: OS << "`-arch` specifier is invalid or missing for universal binary"; break; - default: - llvm_unreachable("invalid coverage mapping error."); } // If optional error message is not empty, append it to the message.