Rollback r257547 -- buildbot failure TBI
[oota-llvm.git] / lib / ProfileData / CoverageMappingReader.cpp
index 32c692d8073a76a8664cea15fcdbb9d8da313a9d..af6c616fa0311bf0bb0f6d67e6df32f0d066d6f0 100644 (file)
@@ -328,12 +328,8 @@ static std::error_code readCoverageMappingData(
     uint32_t Version = endian::byte_swap<uint32_t, Endian>(CovHeader->Version);
     Buf = reinterpret_cast<const char *>(++CovHeader);
 
     uint32_t Version = endian::byte_swap<uint32_t, Endian>(CovHeader->Version);
     Buf = reinterpret_cast<const char *>(++CovHeader);
 
-    switch (Version) {
-    case CoverageMappingVersion1:
-      break;
-    default:
+    if (Version > coverage::CoverageMappingCurrentVersion)
       return coveragemap_error::unsupported_version;
       return coveragemap_error::unsupported_version;
-    }
 
     // Skip past the function records, saving the start and end for later.
     const char *FunBuf = Buf;
 
     // Skip past the function records, saving the start and end for later.
     const char *FunBuf = Buf;