1
Fork 0

coverage: Mappings for unused functions can all be zero

There is no need to include a dummy counter reference in the coverage mappings
for an unused function.
This commit is contained in:
Zalathar 2023-09-07 19:58:11 +10:00
parent 2e5a9dd6c9
commit 59a11af1f9
10 changed files with 65 additions and 73 deletions

View file

@ -14,23 +14,23 @@ Number of file 0 mappings: 4
= (c1 + (c0 - c1))
Function name: dead_code::unused_fn (unused)
Raw bytes (24): 0x[01, 01, 00, 04, 01, 0f, 01, 07, 0f, 00, 07, 10, 02, 06, 00, 02, 06, 00, 07, 00, 01, 01, 00, 02]
Raw bytes (24): 0x[01, 01, 00, 04, 00, 0f, 01, 07, 0f, 00, 07, 10, 02, 06, 00, 02, 06, 00, 07, 00, 01, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 4
- Code(Counter(0)) at (prev + 15, 1) to (start + 7, 15)
- Code(Zero) at (prev + 15, 1) to (start + 7, 15)
- Code(Zero) at (prev + 7, 16) to (start + 2, 6)
- Code(Zero) at (prev + 2, 6) to (start + 0, 7)
- Code(Zero) at (prev + 1, 1) to (start + 0, 2)
Function name: dead_code::unused_pub_fn_not_in_library (unused)
Raw bytes (24): 0x[01, 01, 00, 04, 01, 03, 01, 07, 0f, 00, 07, 10, 02, 06, 00, 02, 06, 00, 07, 00, 01, 01, 00, 02]
Raw bytes (24): 0x[01, 01, 00, 04, 00, 03, 01, 07, 0f, 00, 07, 10, 02, 06, 00, 02, 06, 00, 07, 00, 01, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 4
- Code(Counter(0)) at (prev + 3, 1) to (start + 7, 15)
- Code(Zero) at (prev + 3, 1) to (start + 7, 15)
- Code(Zero) at (prev + 7, 16) to (start + 2, 6)
- Code(Zero) at (prev + 2, 6) to (start + 0, 7)
- Code(Zero) at (prev + 1, 1) to (start + 0, 2)