[clang] [llvm] [MC/DC] Refactor: Make `MCDCParams` as `std::variant` (PR #81227)

NAKAMURA Takumi via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 11 20:10:22 PST 2024


================
@@ -308,13 +309,21 @@ Error RawCoverageMappingReader::readMappingRegionsSubArray(
             return Err;
           if (auto Err = readIntMax(FID, std::numeric_limits<unsigned>::max()))
             return Err;
+          if (ID == 0)
+            return make_error<CoverageMapError>(
+                coveragemap_error::malformed,
+                "MCDCConditionID shouldn't be zero");
+          Params = CounterMappingRegion::MCDCBranchParameters{
+              (unsigned)ID, (unsigned)TID, (unsigned)FID};
----------------
chapuni wrote:

I was so lazy since their casts would be removed by other PRs. I'll do shortly.

https://github.com/llvm/llvm-project/pull/81227


More information about the llvm-commits mailing list