-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(DRAFT) Combined draft branch for coverage work #115428
Commits on Oct 21, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 7a4ec81 - Browse repository at this point
Copy the full SHA 7a4ec81View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6b2e80c - Browse repository at this point
Copy the full SHA 6b2e80cView commit details -
coverage: Change query
codegened_and_inlined_items
to a plain functionThis query has a name that sounds general-purpose, but in fact it has coverage-specific semantics, and (fortunately) is only used by coverage code. Because it is only ever called once, it doesn't need to be a query, and we can change it to a regular function instead.
Configuration menu - View commit details
-
Copy full SHA for 15ffe3d - Browse repository at this point
Copy the full SHA 15ffe3dView commit details -
coverage: Force
-Copt-level=2
in the unreachable-code testThis test is mainly for detecting problems triggered by MIR optimizations, but the run-coverage tests don't enable optimization by default. (The coverage-map tests do enable optimization by default, but I'm updating the test anyway so that the two `unreachable.rs` files don't drift out of sync.)
Configuration menu - View commit details
-
Copy full SHA for 11aeb69 - Browse repository at this point
Copy the full SHA 11aeb69View commit details -
coverage: Repair instrumented functions that have lost all their coun…
…ters If a function has been instrumented for coverage, but MIR optimizations subsequently remove all of its counter-increment statements, then we won't emit LLVM counter-increment intrinsics. LLVM will think the function is not instrumented, and it will disappear from coverage mappings and coverage reports. This new MIR pass detects when that has happened, and re-inserts a dummy counter-increment statement so that LLVM knows to treat the function as instrumented.
Configuration menu - View commit details
-
Copy full SHA for 9886ac6 - Browse repository at this point
Copy the full SHA 9886ac6View commit details -
Configuration menu - View commit details
-
Copy full SHA for ea929a5 - Browse repository at this point
Copy the full SHA ea929a5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 81b4ab7 - Browse repository at this point
Copy the full SHA 81b4ab7View commit details -
Configuration menu - View commit details
-
Copy full SHA for c4f5e60 - Browse repository at this point
Copy the full SHA c4f5e60View commit details -
Configuration menu - View commit details
-
Copy full SHA for b8fc5a0 - Browse repository at this point
Copy the full SHA b8fc5a0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 63ecc25 - Browse repository at this point
Copy the full SHA 63ecc25View commit details -
Configuration menu - View commit details
-
Copy full SHA for 340b7d1 - Browse repository at this point
Copy the full SHA 340b7d1View commit details -
coverage: Emit the filenames section before encoding per-function map…
…pings Most coverage metadata is encoded into two sections in the final executable. The `__llvm_covmap` section mostly just contains a list of filenames, while the `__llvm_covfun` section contains encoded coverage maps for each instrumented function. The catch is that each per-function record also needs to contain a hash of the filenames list that it refers to. Historically this was handled by assembling most of the per-function data into a temporary list, then assembling the filenames buffer, then using the filenames hash to emit the per-function data, and then finally emitting the filenames table itself. However, now that we build the filenames table up-front (via a separate traversal of the per-function data), we can hash and emit that part first, and then emit each of the per-function records immediately after building. This removes the awkwardness of having to temporarily store nearly-complete per-function records.
Configuration menu - View commit details
-
Copy full SHA for 639d00c - Browse repository at this point
Copy the full SHA 639d00cView commit details -
coverage: Consolidate creation of
__llvm_covmap
recordsThe code for creating these records was spread across multiple functions and multiple files, so this change moves as much of it as possible into one place.
Configuration menu - View commit details
-
Copy full SHA for db35232 - Browse repository at this point
Copy the full SHA db35232View commit details