about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-04-07 22:29:20 +1000
committerGitHub <noreply@github.com>2025-04-07 22:29:20 +1000
commitddf099ff4e19e7cdfbef2a4f6f02f99793c40868 (patch)
tree785ba05c651fea4c0bdc0462059b6204647af841 /compiler/rustc_codegen_gcc
parentf4c429fde57a4a59cb8537205e85688741aeffc6 (diff)
parent4322b6e97d6ad438c6c9ef1ea92e8ba00c056d9c (diff)
downloadrust-ddf099ff4e19e7cdfbef2a4f6f02f99793c40868.tar.gz
rust-ddf099ff4e19e7cdfbef2a4f6f02f99793c40868.zip
Rollup merge of #139397 - Zalathar:virtual, r=jieyouxu
coverage: Build the CGU's global file table as late as possible

Embedding coverage metadata in the output binary is a delicate dance, because per-function records need to embed references to the per-CGU filename table, but we only want to include files in that table if they are successfully used by at least one function.

The way that we build the file tables has changed a few times over the last few years. This particular change is motivated by experimental work on properly supporting macro-expansion regions, which adds some additional constraints that our previous implementation wasn't equipped to deal with.

LLVM is very strict about not allowing unused entries in local file tables. Currently that's not much of an issue, because we assume one source file per function, but to support expansion regions we need the flexibility to avoid committing to the use of a file until we're completely sure that we are able and willing to produce at least one coverage mapping region for it. In particular, when preparing a function's covfun record, we need the flexibility to decide at a late stage that a particular file isn't needed/usable after all.

(It's OK for the *global* file table to contain unused entries, but we would still prefer to avoid that if possible, and this implementation also achieves that.)
Diffstat (limited to 'compiler/rustc_codegen_gcc')
0 files changed, 0 insertions, 0 deletions