[all-commits] [llvm/llvm-project] 859bf4: [Coverage] Emit a gap region to cover switch bodies

Vedant Kumar via All-commits all-commits at lists.llvm.org
Tue Dec 3 12:36:00 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 859bf4d2bea2404bd2eac92451f2db4371ec6eb4
      https://github.com/llvm/llvm-project/commit/859bf4d2bea2404bd2eac92451f2db4371ec6eb4
  Author: Vedant Kumar <vsk at apple.com>
  Date:   2019-12-03 (Tue, 03 Dec 2019)

  Changed paths:
    M clang/docs/SourceBasedCodeCoverage.rst
    M clang/lib/CodeGen/CoverageMappingGen.cpp
    M clang/test/CoverageMapping/switch.cpp
    M clang/test/CoverageMapping/switchmacro.c

  Log Message:
  -----------
  [Coverage] Emit a gap region to cover switch bodies

Emit a gap region beginning where the switch body begins. This sets line
execution counts in the areas between non-overlapping cases to 0.

This also removes some special handling of the first case in a switch:
these are now treated like any other case.

This does not resolve an outstanding issue with case statement regions
that do not end when a region is terminated. But it should address
llvm.org/PR44011.

Differential Revision: https://reviews.llvm.org/D70571




More information about the All-commits mailing list