about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2023-08-13 21:00:46 +0200
committerGitHub <noreply@github.com>2023-08-13 21:00:46 +0200
commit2442c9b7243d1c79588ba8e1b997f9dfb3705a1b (patch)
treee364cfa166ba988012d415bf9995257bd0903c42 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parent99144c3f048a40461bc805cc3be25e60743ec77b (diff)
parent5ca30c4646cb03387d2770fc759ea40c58344831 (diff)
downloadrust-2442c9b7243d1c79588ba8e1b997f9dfb3705a1b.tar.gz
rust-2442c9b7243d1c79588ba8e1b997f9dfb3705a1b.zip
Rollup merge of #114354 - Zalathar:external-counters, r=jackh726
coverage: Store BCB counter info externally, not directly in the BCB graph

When deciding how to instrument the underlying MIR for coverage, the `InstrumentCoverage` pass builds a simplified “Basic Counter Block” graph, and then allocates coverage counters/expressions to various nodes/edges in the BCB graph as necessary. Those counters/expressions are then injected into the function's MIR.

The awkward thing here is that the code for doing this needs `&mut` access to the graph, in order to associate coverage info with individual nodes, even though it isn't making any structural changes to the graph itself. That makes it harder to understand and modify the instrumentation code.

In addition, the graph alone can't hold all the information that is needed. There ends up being an extra vector of “intermediate expressions” that needs to be passed around separately anyway.

---

This PR simplifies things by instead storing all of that temporary coverage information in a number of side-tables inside `CoverageCounters`.

This makes it easier to see all of the information produced by the make-counters step, and how it is used by the inject-into-mir step.

---

Looking at the combined changes is possible, but I recommend reviewing the commits individually, because the big changes are mostly independent of each other (despite being conceptually related).
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions