about summary refs log tree commit diff
path: root/tests/coverage
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-12-17 22:34:42 +0100
committerGitHub <noreply@github.com>2024-12-17 22:34:42 +0100
commite696f5c180400f420ea7d38c9bdda51928ef2092 (patch)
tree37c3ac9fd502ee7dbb93b2935ba514c6a22bf791 /tests/coverage
parentca5dfa74f16a36013db4d35de4c310df74f94e0a (diff)
parent541d4e85d90b4c0416014c3620d3f3c9771bd476 (diff)
downloadrust-e696f5c180400f420ea7d38c9bdda51928ef2092.tar.gz
rust-e696f5c180400f420ea7d38c9bdda51928ef2092.zip
Rollup merge of #134323 - Zalathar:dismantle-map-data, r=jieyouxu
coverage: Dismantle `map_data.rs` by moving its responsibilities elsewhere

This is a series of incremental changes that combine to let us get rid of `coverageinfo/map_data.rs`, by moving all of its responsibilities into more appropriate places.

Some of the notable consequences are:

- We once again build the per-CGU file table on the fly while preparing individual covfun records, instead of building the whole table up-front. The up-front approach was introduced by #117042 to work around various other problems in generating the covmap/covfun records, but subsequent cleanups have made that approach no longer necessary.
- Expression conversion and mapping-region conversion are now performed directly in `mapgen::covfun`, which should make future changes easier.
- We no longer insert unused function instances into the same map that is also used to track used function instances. This helps to decouple the handling of used vs unused functions.

---

There should be no meaningful change to compiler output. The file table is no longer sorted, because reordering it would invalidate the file indices stored in individual covfun records, but the table order should still be deterministic (albeit arbitrary).

There are some subsequent cleanups that I intend to investigate, but this is enough change for one PR.
Diffstat (limited to 'tests/coverage')
-rw-r--r--tests/coverage/unused_mod.cov-map8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/coverage/unused_mod.cov-map b/tests/coverage/unused_mod.cov-map
index af10906fa3c..5e8b69fcdba 100644
--- a/tests/coverage/unused_mod.cov-map
+++ b/tests/coverage/unused_mod.cov-map
@@ -1,16 +1,16 @@
 Function name: unused_mod::main
-Raw bytes (9): 0x[01, 02, 00, 01, 01, 04, 01, 02, 02]
+Raw bytes (9): 0x[01, 01, 00, 01, 01, 04, 01, 02, 02]
 Number of files: 1
-- file 0 => global file 2
+- file 0 => global file 1
 Number of expressions: 0
 Number of file 0 mappings: 1
 - Code(Counter(0)) at (prev + 4, 1) to (start + 2, 2)
 Highest counter ID seen: c0
 
 Function name: unused_mod::unused_module::never_called_function (unused)
-Raw bytes (9): 0x[01, 01, 00, 01, 00, 02, 01, 02, 02]
+Raw bytes (9): 0x[01, 02, 00, 01, 00, 02, 01, 02, 02]
 Number of files: 1
-- file 0 => global file 1
+- file 0 => global file 2
 Number of expressions: 0
 Number of file 0 mappings: 1
 - Code(Zero) at (prev + 2, 1) to (start + 2, 2)