LLVM/project db210c5llvm/include/llvm/Analysis ProfileSummaryInfo.h

[NFC] Prefer compile-time branching in function template (#203698)
DeltaFile
+2-2llvm/include/llvm/Analysis/ProfileSummaryInfo.h
+2-21 files

LLVM/project 0a2565dclang/lib/AST/ByteCode InterpBuiltin.cpp

[clang][bytecode] Use `isSignedType()` in `pushInteger` (#203670)

We need to classify here anyway, so use the information from the
primtype.
DeltaFile
+1-1clang/lib/AST/ByteCode/InterpBuiltin.cpp
+1-11 files

LLVM/project 4331c07libcxx/include optional

[libc++][NFC] Simplify `optional<T>` and `optional<T&>` a bit (#203665)

- Make `optional<T&>`'s iterator base directly from the storage base
instead of inheriting the empty bases, allowing us to remove the
`is_lvalue_reference_v` conditions in the empty bases
- Move the `__is_constructible_for_optional_{meow}` variables closer to
`make_optional` since that's the only place they're really useful for
now
- Change the SFINAE for the iterator availability to use concepts
instead

The above should make it easier to split up in an upcoming patch.
DeltaFile
+62-60libcxx/include/optional
+62-601 files

LLVM/project 0b17f4fclang/include/clang/Analysis/Analyses/LifetimeSafety Origins.h FactsGenerator.h, clang/lib/Analysis/LifetimeSafety Origins.cpp FactsGenerator.cpp

[LifetimeSafety] Track per-field origins for record types
DeltaFile
+348-5clang/test/Sema/warn-lifetime-safety.cpp
+106-7clang/lib/Analysis/LifetimeSafety/Origins.cpp
+69-37clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp
+30-0clang/include/clang/Analysis/Analyses/LifetimeSafety/Origins.h
+4-6clang/test/Sema/warn-lifetime-safety-dangling-field.cpp
+0-2clang/include/clang/Analysis/Analyses/LifetimeSafety/FactsGenerator.h
+557-576 files

LLVM/project 2045695llvm/lib/ProfileData/Coverage CoverageMapping.cpp

[llvm-cov] Fix undercounting lines wrapped by gap regions

Lines with no region entry that are wrapped by a gap region were
reported with the gap's count (often 0), even when non-gap segments
on the line indicated the line was actually executed. This caused
llvm-cov to undercount coverage for lines that continue a covered
region after a gap (e.g., closing braces, simple statements following
an if/else).

Check for non-gap segments with HasCount on such lines and use their
max count instead of the gap region's count.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
DeltaFile
+12-1llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
+12-11 files

LLVM/project 9d43f86llvm/test/tools/llubi inttoptr_multiobj2.ll, llvm/tools/llubi/lib Context.cpp ExecutorBase.cpp

[llubi] Add support for exposed provenance (#200596)

This patch implements the semantics of exposed provenance, as described
in [nikic's RFC draft](https://hackmd.io/@nikic/SJBt4mFCll) and
[Miri](https://doc.rust-lang.org/beta/nightly-rustc/miri/enum.Provenance.html).

The provenance of an inttoptr is marked as "wildcard", which picks one
from previously exposed provenances each time a memory access is
performed. For angelic non-determinism, a snapshot of the exposed
provenance set is recorded when inttoptr executes. When a memory access
is performed, all invalid provenances are masked out. If we fail to pick
one, it is UB.

Since all memory objects in llubi are non-overlapping (i.e., there is at
most one memory object satisfying `Obj->inBounds(Addr)` for each
address), we can determine a unique memory object for a wildcard
provenance when the first memory access is performed.
This matches Miri's behavior. Another variant is to resolve the memory
object when inttoptr executes, which gives a limited provenance set

    [14 lines not shown]
DeltaFile
+102-2llvm/tools/llubi/lib/Context.cpp
+43-47llvm/tools/llubi/lib/ExecutorBase.cpp
+45-19llvm/tools/llubi/lib/Interpreter.cpp
+50-4llvm/tools/llubi/lib/Value.h
+50-2llvm/tools/llubi/lib/Context.h
+41-0llvm/test/tools/llubi/inttoptr_multiobj2.ll
+331-7422 files not shown
+674-15528 files

LLVM/project 4d50e94llvm/lib/ProfileData/Coverage CoverageMapping.cpp

[llvm-cov] Fix undercounting lines wrapped by gap regions

Lines with no region entry that are wrapped by a gap region were
reported with the gap's count (often 0), even when non-gap segments
on the line indicated the line was actually executed. This caused
llvm-cov to undercount coverage for lines that continue a covered
region after a gap (e.g., closing braces, simple statements following
an if/else).

Check for non-gap segments with HasCount on such lines and use their
max count instead of the gap region's count.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
DeltaFile
+12-1llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
+12-11 files

LLVM/project 448f50dllvm/test/tools/llvm-cov gap-region-line-coverage.test, llvm/test/tools/llvm-cov/Inputs/gap-region-quirk gap-quirk-v2.cpp gap-quirk.covmapping

[llvm-cov] Add failing test for gap region line coverage bug

LineCoverageStats incorrectly reports lines as uncovered when a gap
region with count=0 wraps into a line that has non-entry segments
with count > 0.

The test uses a minimal reproducer: a scoped block with a never-taken
early return followed by a statement. The closing "}" produces a gap
region that wraps to the next line, suppressing its execution count.
The extra statement after the if-block is required — without it,
clang emits a region entry (MinRegionCount > 0) and the bug doesn't
trigger.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
DeltaFile
+37-0llvm/test/tools/llvm-cov/gap-region-line-coverage.test
+23-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk-v2.cpp
+0-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.covmapping
+0-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.profdata
+60-04 files

LLVM/project 0034a67llvm/test/tools/llvm-cov gap-region-line-coverage.test, llvm/test/tools/llvm-cov/Inputs/gap-region-quirk gap-quirk-v2.cpp gap-quirk.profdata

[llvm-cov] Add failing test for gap region line coverage bug

LineCoverageStats incorrectly reports lines as uncovered when a gap
region with count=0 wraps into a line that has non-entry segments
with count > 0.

The test uses a minimal reproducer: a scoped block with a never-taken
early return followed by a statement. The closing "}" produces a gap
region that wraps to the next line, suppressing its execution count.
The extra statement after the if-block is required — without it,
clang emits a region entry (MinRegionCount > 0) and the bug doesn't
trigger.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
DeltaFile
+37-0llvm/test/tools/llvm-cov/gap-region-line-coverage.test
+23-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk-v2.cpp
+0-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.profdata
+0-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.covmapping
+60-04 files

LLVM/project 25f2190llvm/test/tools/llvm-cov gap-region-line-coverage.test, llvm/test/tools/llvm-cov/Inputs/gap-region-quirk gap-quirk-v2.cpp gap-quirk.profdata

[llvm-cov] Add failing test for gap region line coverage bug

LineCoverageStats incorrectly reports lines as uncovered when a gap
region with count=0 wraps into a line that has non-entry segments
with count > 0.

The test uses a minimal reproducer: a scoped block with a never-taken
early return followed by a statement. The closing "}" produces a gap
region that wraps to the next line, suppressing its execution count.
The extra statement after the if-block is required — without it,
clang emits a region entry (MinRegionCount > 0) and the bug doesn't
trigger.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
DeltaFile
+37-0llvm/test/tools/llvm-cov/gap-region-line-coverage.test
+23-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk-v2.cpp
+0-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.profdata
+0-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.covmapping
+60-04 files

LLVM/project 32e3485llvm/test/tools/llvm-cov gap-region-line-coverage.test, llvm/test/tools/llvm-cov/Inputs/gap-region-quirk gap-quirk-v2.cpp gap-quirk.profdata

[llvm-cov] Add failing test for gap region line coverage bug

LineCoverageStats incorrectly reports lines as uncovered when a gap
region with count=0 wraps into a line that has non-entry segments
with count > 0.

The test uses a minimal reproducer: a scoped block with a never-taken
early return followed by a statement. The closing "}" produces a gap
region that wraps to the next line, suppressing its execution count.
The extra statement after the if-block is required — without it,
clang emits a region entry (MinRegionCount > 0) and the bug doesn't
trigger.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
DeltaFile
+36-0llvm/test/tools/llvm-cov/gap-region-line-coverage.test
+23-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk-v2.cpp
+0-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.profdata
+0-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.covmapping
+59-04 files

LLVM/project 4902857llvm/test/tools/llvm-cov gap-region-line-coverage.test, llvm/test/tools/llvm-cov/Inputs/gap-region-quirk gap-quirk-v2.cpp gap-quirk.profdata

[llvm-cov] Add failing test for gap region line coverage bug

LineCoverageStats incorrectly reports lines as uncovered when a gap
region with count=0 wraps into a line that has non-entry segments
with count > 0.

The test uses a minimal reproducer: a scoped block with a never-taken
early return followed by a statement. The closing "}" produces a gap
region that wraps to the next line, suppressing its execution count.
The extra statement after the if-block is required — without it,
clang emits a region entry (MinRegionCount > 0) and the bug doesn't
trigger.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
DeltaFile
+34-0llvm/test/tools/llvm-cov/gap-region-line-coverage.test
+23-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk-v2.cpp
+0-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.profdata
+0-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.covmapping
+57-04 files

LLVM/project 5db7e5bllvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 ordered-reduction-replaced.ll reduction-ordered-fadd.ll

[SLP]Keep ordered fadd reductions sequential

tryToReduceOrdered vectorizes reductions that are not associative (e.g. an
fadd with reassoc but without nsz). The accumulation order must be
preserved, but the reduction was costed and emitted with reassoc, and the
whole tree was rotated to memory order by reorderTopToBottom, which can
change the result of the sequential reduction.

Drop reassoc from the flags used to cost and emit the reduction so the
generated llvm.vector.reduce.fadd stays ordered, and drop the top-to-bottom
reorder so the reduced values keep their original accumulation order.

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/203741
DeltaFile
+5-6llvm/test/Transforms/SLPVectorizer/X86/ordered-reduction-replaced.ll
+8-1llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+3-2llvm/test/Transforms/SLPVectorizer/X86/reduction-ordered-fadd.ll
+2-1llvm/test/Transforms/SLPVectorizer/X86/ordered-reduction-root-deleted.ll
+18-104 files

LLVM/project e159976llvm/test/tools/llvm-cov gap-region-line-coverage.test, llvm/test/tools/llvm-cov/Inputs/gap-region-quirk gap-quirk-v2.cpp gap-quirk.covmapping

[llvm-cov] Add failing test for gap region line coverage bug

LineCoverageStats incorrectly reports lines as uncovered when a gap
region with count=0 wraps into a line that has non-entry segments
with count > 0.

The test demonstrates this with two scoped blocks containing
never-taken early returns. The statement between them ("int result =
42;") and after them ("return true;") are genuinely executed but
reported with count=0 because the gap region from each block's
closing "}" incorrectly suppresses the line's execution count.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
DeltaFile
+41-0llvm/test/tools/llvm-cov/gap-region-line-coverage.test
+28-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk-v2.cpp
+0-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.covmapping
+0-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.profdata
+69-04 files

LLVM/project f7f904fllvm/test/Transforms/SLPVectorizer/X86 reduction-ordered-fadd.ll

[SLP][NFC]Add a test with miscompiled ordered reductions, NFC



Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/203738
DeltaFile
+164-0llvm/test/Transforms/SLPVectorizer/X86/reduction-ordered-fadd.ll
+164-01 files

LLVM/project 5131f00clang/lib/CodeGen CGExprCXX.cpp, clang/test/CodeGen ubsan-aggregate-null-align-bounds.c

[UBSan] Use EmitCheckedLValue for C++ trivial operator= operands

Further to https://github.com/llvm/llvm-project/pull/190739, use
EmitCheckedLValue for trivial operator= operands
* for the LHS (`lhs->` not handled yet), and
* for the RHS also for function call syntax.
DeltaFile
+38-23clang/test/CodeGen/ubsan-aggregate-null-align-bounds.c
+27-16clang/lib/CodeGen/CGExprCXX.cpp
+65-392 files

LLVM/project 29656a1llvm/test/tools/llvm-cov gap-region-line-coverage.test, llvm/test/tools/llvm-cov/Inputs/gap-region-quirk gap-quirk.cpp gap-quirk-v2.cpp

[llvm-cov] Add failing test for gap region line coverage bug

LineCoverageStats incorrectly reports lines as uncovered when a gap
region with count=0 wraps into a line that has non-entry segments
with count > 0.

The test demonstrates this with two scoped blocks containing
never-taken early returns. The statement between them ("int result =
42;") and after them ("return true;") are genuinely executed but
reported with count=0 because the gap region from each block's
closing "}" incorrectly suppresses the line's execution count.

Test inputs generated with Apple system clang which produces this
specific segment pattern. Upstream clang does not produce gap regions
in this context.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
DeltaFile
+35-0llvm/test/tools/llvm-cov/gap-region-line-coverage.test
+28-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.cpp
+28-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk-v2.cpp
+0-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.profdata
+0-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.covmapping
+91-05 files

LLVM/project e84e480flang/lib/Optimizer/Transforms/CUDA CUFDeviceFuncTransform.cpp, flang/test/Fir/CUDA cuda-device-func-transform.mlir

Revert "[flang][cuda] Set kernel intent(in) as const __restrict__" (#203734)

Reverts llvm/llvm-project#203652

breaking some downstream cudafor code
DeltaFile
+0-38flang/lib/Optimizer/Transforms/CUDA/CUFDeviceFuncTransform.cpp
+2-16flang/test/Fir/CUDA/cuda-device-func-transform.mlir
+2-542 files

LLVM/project d7ce529llvm/test/tools/llvm-cov gap-region-line-coverage.test, llvm/test/tools/llvm-cov/Inputs/gap-region-quirk gap-quirk.cpp gap-quirk.covmapping

[llvm-cov] Add failing test for gap region line coverage bug

LineCoverageStats incorrectly reports a line as uncovered when the
wrapping segment has count=0 and the line has no region entries, even
if it has non-entry segments with count > 0.

This test uses coverage data from Apple clang which produces the
specific segment pattern that triggers this: a closing brace "}" after
a never-taken if-block, where the non-gap segment returning to the
parent function's count is ignored.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
DeltaFile
+30-0llvm/test/tools/llvm-cov/gap-region-line-coverage.test
+13-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.cpp
+0-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.covmapping
+0-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.profdata
+43-04 files

LLVM/project a68a70aflang/lib/Optimizer/Transforms/CUDA CUFDeviceFuncTransform.cpp, flang/test/Fir/CUDA cuda-device-func-transform.mlir

Revert "[flang][cuda] Set kernel intent(in) as const __restrict__ (#203652)"

This reverts commit 7670d88e7ea753095f753e6616b66f5e74da42ef.
DeltaFile
+0-38flang/lib/Optimizer/Transforms/CUDA/CUFDeviceFuncTransform.cpp
+2-16flang/test/Fir/CUDA/cuda-device-func-transform.mlir
+2-542 files

LLVM/project 640dec9llvm/lib/ProfileData/Coverage CoverageMapping.cpp, llvm/test/tools/llvm-cov exclude-markers.test

[CoverageMapping] Fix LineCoverageStats incorrectly using gap region count

When a line's wrapping segment is a gap region with count=0, but the
line has non-gap segments with count > 0 (not region entries),
LineCoverageStats incorrectly reports the line as uncovered.

This happens when a zero-count gap region (e.g., from a never-taken
if-branch closing brace) extends past subsequent covered lines. The
fix checks non-gap HasCount segments on the line when MinRegionCount
is 0, using their max count instead of the gap's count.

Also skip initializing ExecutionCount from a gap wrapping segment,
since gap regions should not contribute to the line's execution count.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
DeltaFile
+31-23llvm/test/tools/llvm-cov/exclude-markers.test
+15-0llvm/test/tools/llvm-cov/Inputs/exclude-markers-stop-before-start/report-stop-before-start.cpp
+10-2llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
+6-0llvm/tools/llvm-cov/CoverageViewOptions.h
+0-0llvm/test/tools/llvm-cov/Inputs/exclude-markers-stop-before-start/report-stop-before-start.profdata
+0-0llvm/test/tools/llvm-cov/Inputs/exclude-markers-stop-before-start/report-stop-before-start.covmapping
+62-256 files

LLVM/project 3a46e59clang/test/CodeGen ubsan-aggregate-null-align.c ubsan-aggregate-null-align-bounds.c

[NFC][tests] Rename test file and function names to reflect scope/content (#203731)

Rename test file to reflect scope (includes array bounds checking).

Rename test functions for internal convention consistency:
Consistently use "deref" and "subscript" to refer to `*p` and `arr[idx]`
expression forms.
DeltaFile
+0-170clang/test/CodeGen/ubsan-aggregate-null-align.c
+170-0clang/test/CodeGen/ubsan-aggregate-null-align-bounds.c
+170-1702 files

LLVM/project 983fd89llvm/lib/ProfileData/Coverage CoverageMapping.cpp

[CoverageMapping] Fix LineCoverageStats incorrectly using gap region count

When a line's wrapping segment is a gap region with count=0, but the
line has non-gap segments with count > 0 (not region entries),
LineCoverageStats incorrectly reports the line as uncovered.

This happens when a zero-count region (e.g., from a never-taken
if-branch) extends past subsequent covered lines via a gap segment.
The fix:
1. Skip initializing ExecutionCount from gap wrapping segments
2. When MinRegionCount is 0, check non-gap HasCount segments on the
   line and use their max count

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
DeltaFile
+10-2llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
+10-21 files

LLVM/project 0085eabllvm/test/tools/llvm-cov gap-region-line-coverage.test, llvm/test/tools/llvm-cov/Inputs/gap-region-quirk gap-quirk.cpp gap-quirk.covmapping

[llvm-cov] Add failing test for gap region line coverage bug

LineCoverageStats incorrectly reports a line as uncovered when the
wrapping segment has count=0 and the line has no region entries, even
if it has non-entry segments with count > 0.

This test uses coverage data from Apple clang which produces the
specific segment pattern that triggers this: a closing brace "}" after
a never-taken if-block, where the non-gap segment returning to the
parent function's count is ignored.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
DeltaFile
+32-0llvm/test/tools/llvm-cov/gap-region-line-coverage.test
+13-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.cpp
+0-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.covmapping
+0-0llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.profdata
+45-04 files

LLVM/project cb9f268clang/include/clang/Analysis/Analyses/LifetimeSafety Origins.h FactsGenerator.h, clang/lib/Analysis/LifetimeSafety FactsGenerator.cpp Origins.cpp

[LifetimeSafety] Track per-field origins for record types
DeltaFile
+348-5clang/test/Sema/warn-lifetime-safety.cpp
+69-37clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp
+82-5clang/lib/Analysis/LifetimeSafety/Origins.cpp
+30-0clang/include/clang/Analysis/Analyses/LifetimeSafety/Origins.h
+4-6clang/test/Sema/warn-lifetime-safety-dangling-field.cpp
+0-2clang/include/clang/Analysis/Analyses/LifetimeSafety/FactsGenerator.h
+533-556 files

LLVM/project 5e7f581clang/test/CodeGen ubsan-aggregate-null-align-bounds.c

[NFC] Rename test functions for internal convention consistency

Consistently use "deref" and "subscript" to refer to `*p` and `arr[idx]`
expression forms.
DeltaFile
+4-4clang/test/CodeGen/ubsan-aggregate-null-align-bounds.c
+4-41 files

LLVM/project 5f8c9aeclang/test/CodeGen ubsan-aggregate-null-align.c ubsan-aggregate-null-align-bounds.c

[NFC] Rename test to reflect scope (array bounds checking)
DeltaFile
+0-170clang/test/CodeGen/ubsan-aggregate-null-align.c
+170-0clang/test/CodeGen/ubsan-aggregate-null-align-bounds.c
+170-1702 files

LLVM/project cbdb857llvm/lib/ProfileData/Coverage CoverageMapping.cpp, llvm/test/tools/llvm-cov exclude-markers.test

[CoverageMapping] Fix LineCoverageStats incorrectly using gap region count

When a line's wrapping segment is a gap region with count=0, but the
line has non-gap segments with count > 0 (not region entries),
LineCoverageStats incorrectly reports the line as uncovered.

This happens when a zero-count gap region (e.g., from a never-taken
if-branch closing brace) extends past subsequent covered lines. The
fix checks non-gap HasCount segments on the line when MinRegionCount
is 0, using their max count instead of the gap's count.

Also skip initializing ExecutionCount from a gap wrapping segment,
since gap regions should not contribute to the line's execution count.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
DeltaFile
+23-23llvm/test/tools/llvm-cov/exclude-markers.test
+10-2llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
+33-252 files

LLVM/project baff7e5llvm/test/tools/llvm-cov exclude-markers.test, llvm/tools/llvm-cov CodeCoverage.cpp CoverageViewOptions.h

[llvm-cov] Add inline exclusion marker support for coverage reporting

Add --exclude-line-regex, --exclude-region-start-regex, and
--exclude-region-stop-regex options to llvm-cov. These allow excluding
lines from coverage totals based on inline source comments.

Defaults: LCOV_EXCL_LINE (single line), LCOV_EXCL_START/LCOV_EXCL_STOP
(region). This brings parity with lcov/gcov's exclusion markers and
kcov's --exclude-line regex support.

The implementation scans source files for markers when loaded, builds a
per-file set of excluded line numbers, and consistently applies
exclusions across all output formats:
- Line coverage totals (subtracted in prepareFileReports)
- Region coverage totals (regions starting on excluded lines)
- Function coverage totals (functions starting on excluded lines)
- "show" text output (no count column, no red highlighting)
- "show" HTML output (skipped-line class instead of uncovered-line)
- JSON export segments (filtered out)

    [6 lines not shown]
DeltaFile
+290-0llvm/test/tools/llvm-cov/exclude-markers.test
+62-1llvm/tools/llvm-cov/CodeCoverage.cpp
+58-0llvm/tools/llvm-cov/CoverageViewOptions.h
+36-15llvm/tools/llvm-cov/CoverageExporterLcov.cpp
+32-0llvm/tools/llvm-cov/CoverageReport.cpp
+27-0llvm/tools/llvm-cov/CoverageSummaryInfo.h
+505-1619 files not shown
+618-3525 files

LLVM/project efc03bdllvm/test/tools/llvm-cov exclude-markers.test, llvm/tools/llvm-cov CodeCoverage.cpp CoverageViewOptions.h

[llvm-cov] Add inline exclusion marker support for coverage reporting

Add --exclude-line-regex, --exclude-region-start-regex, and
--exclude-region-stop-regex options to llvm-cov. These allow excluding
lines from coverage totals based on inline source comments.

Defaults: LCOV_EXCL_LINE (single line), LCOV_EXCL_START/LCOV_EXCL_STOP
(region). This brings parity with lcov/gcov's exclusion markers and
kcov's --exclude-line regex support.

The implementation scans source files for markers when loaded, builds a
per-file set of excluded line numbers, and consistently applies
exclusions across all output formats:
- Line coverage totals (subtracted in prepareFileReports)
- Region coverage totals (regions starting on excluded lines)
- Function coverage totals (functions starting on excluded lines)
- "show" text output (no count column, no red highlighting)
- "show" HTML output (skipped-line class instead of uncovered-line)
- JSON export segments (filtered out)

    [6 lines not shown]
DeltaFile
+290-0llvm/test/tools/llvm-cov/exclude-markers.test
+62-1llvm/tools/llvm-cov/CodeCoverage.cpp
+58-0llvm/tools/llvm-cov/CoverageViewOptions.h
+36-15llvm/tools/llvm-cov/CoverageExporterLcov.cpp
+32-0llvm/tools/llvm-cov/CoverageReport.cpp
+27-0llvm/tools/llvm-cov/CoverageSummaryInfo.h
+505-1619 files not shown
+618-3525 files