[all-commits] [llvm/llvm-project] a6817b: CoverageMappingWriter: Emit `Decision` before `Exp...

NAKAMURA Takumi via All-commits all-commits at lists.llvm.org
Mon Feb 5 11:33:37 PST 2024


  Branch: refs/heads/release/18.x
  Home:   https://github.com/llvm/llvm-project
  Commit: a6817b7315af5da94cfbe69767c8e8f827fecbca
      https://github.com/llvm/llvm-project/commit/a6817b7315af5da94cfbe69767c8e8f827fecbca
  Author: NAKAMURA Takumi <geek4civic at gmail.com>
  Date:   2024-02-05 (Mon, 05 Feb 2024)

  Changed paths:
    M llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp
    M llvm/unittests/ProfileData/CoverageMappingTest.cpp

  Log Message:
  -----------
  CoverageMappingWriter: Emit `Decision` before `Expansion` (#78966)

To relax scanning record, tweak order by `Decision < Expansion`, or
`Expansion` could not be distinguished whether it belonged to `Decision`
or not.

Relevant to #77871

(cherry picked from commit 438fe1db09b0c20708ea1020519d8073c37feae8)


  Commit: b50a84e303378df35996d7330aa80aa4ea1f497a
      https://github.com/llvm/llvm-project/commit/b50a84e303378df35996d7330aa80aa4ea1f497a
  Author: NAKAMURA Takumi <geek4civic at gmail.com>
  Date:   2024-02-05 (Mon, 05 Feb 2024)

  Changed paths:
    M llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
    A llvm/test/tools/llvm-cov/Inputs/mcdc-macro.c
    A llvm/test/tools/llvm-cov/Inputs/mcdc-macro.o
    A llvm/test/tools/llvm-cov/Inputs/mcdc-macro.proftext
    A llvm/test/tools/llvm-cov/mcdc-macro.test

  Log Message:
  -----------
  [Coverage] Let `Decision` take account of expansions (#78969)

The current implementation (D138849) assumes `Branch`(es) would follow
after the corresponding `Decision`. It is not true if `Branch`(es) are
forwarded to expanded file ID. As a result, consecutive `Decision`(s)
would be confused with insufficient number of `Branch`(es).

`Expansion` will point `Branch`(es) in other file IDs if `Expansion` is
included in the range of `Decision`.

Fixes #77871

---------

Co-authored-by: Alan Phipps <a-phipps at ti.com>
(cherry picked from commit d912f1f0cb49465b08f82fae89ece222404e5640)


Compare: https://github.com/llvm/llvm-project/compare/43db795259d9...b50a84e30337


More information about the All-commits mailing list