rust/compiler
bors 4ffb5c5954 Auto merge of #76004 - richkadel:llvm-coverage-map-gen-6b.5, r=tmandry
Tools, tests, and experimenting with MIR-derived coverage counters

Leverages the new mir_dump output file in HTML+CSS (from #76074) to visualize coverage code regions
and the MIR features that they came from (including overlapping spans).

See example below.

The `run-make-fulldeps/instrument-coverage` test has been refactored to maximize test coverage and reduce code duplication. The new tests support testing with and without `-Clink-dead-code`, so Rust coverage can be tested on MSVC (which, currently, only works with `link-dead-code` _disabled_).

New tests validate coverage region generation and coverage reports with multiple counters per function. Starting with a simple `if-else` branch tests, coverage tests for each additional syntax type can be added by simply dropping in a new Rust sample program.

Includes a basic, MIR-block-based implementation of coverage injection,
available via `-Zexperimental-coverage`. This implementation has known
flaws and omissions, but is simple enough to validate the new tools and
tests.

The existing `-Zinstrument-coverage` option currently enables
function-level coverage only, which at least appears to generate
accurate coverage reports at that level.

Experimental coverage is not accurate at this time. When branch coverage
works as intended, the `-Zexperimental-coverage` option should be
removed.

This PR replaces the bulk of PR #75828, with the remaining parts of
that PR distributed among other separate and indentpent PRs.

This PR depends on two of those other PRs: #76002, #76003 and #76074

Rust compiler MCP rust-lang/compiler-team#278

Relevant issue: #34701 - Implement support for LLVMs code coverage
instrumentation

![Screen-Recording-2020-08-21-at-2](https://user-images.githubusercontent.com/3827298/90972923-ff417880-e4d1-11ea-92bb-8713c6198f6d.gif)

r? @tmandry
FYI: @wesleywiser
2020-09-04 01:31:07 +00:00
..
rustc
rustc_apfloat
rustc_arena
rustc_ast Auto merge of #76170 - matklad:notrivia, r=petrochenkov 2020-09-02 03:19:38 +00:00
rustc_ast_lowering
rustc_ast_passes
rustc_ast_pretty Auto merge of #76170 - matklad:notrivia, r=petrochenkov 2020-09-02 03:19:38 +00:00
rustc_attr
rustc_builtin_macros Improve recovery on malformed format call 2020-09-02 13:18:19 +02:00
rustc_codegen_llvm pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
rustc_codegen_ssa Auto merge of #73996 - da-x:short-unique-paths, r=petrochenkov 2020-09-03 23:27:45 +00:00
rustc_data_structures Auto merge of #76233 - cuviper:unhasher, r=Mark-Simulacrum 2020-09-02 22:16:22 +00:00
rustc_driver Auto merge of #73996 - da-x:short-unique-paths, r=petrochenkov 2020-09-03 23:27:45 +00:00
rustc_error_codes Rollup merge of #76143 - jyn514:duplicate-builtin-macros, r=petrochenkov 2020-09-01 18:24:35 -07:00
rustc_errors rustc_{errors,session}: add delay_good_path_bug 2020-09-02 10:43:17 +03:00
rustc_expand Auto merge of #76170 - matklad:notrivia, r=petrochenkov 2020-09-02 03:19:38 +00:00
rustc_feature driver: replace lazy_static by SyncLazy from std 2020-09-01 22:06:47 +01:00
rustc_fs_util
rustc_graphviz
rustc_hir hir: replace lazy_static by SyncLazy from std 2020-09-01 22:06:47 +01:00
rustc_hir_pretty
rustc_incremental
rustc_index
rustc_infer Fix some unwanted uses of Debug formatting on user-facing messages 2020-09-02 10:40:10 +03:00
rustc_interface Auto merge of #73996 - da-x:short-unique-paths, r=petrochenkov 2020-09-03 23:27:45 +00:00
rustc_lexer lexer: Tiny improvement to shebang detection 2020-09-02 00:40:19 +03:00
rustc_lint rustc_lint: avoid trimmed paths for ty_find_init_error 2020-09-03 14:36:58 +03:00
rustc_macros pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
rustc_metadata
rustc_middle Auto merge of #76004 - richkadel:llvm-coverage-map-gen-6b.5, r=tmandry 2020-09-04 01:31:07 +00:00
rustc_mir Auto merge of #76004 - richkadel:llvm-coverage-map-gen-6b.5, r=tmandry 2020-09-04 01:31:07 +00:00
rustc_mir_build pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
rustc_parse Auto merge of #76160 - scileo:format-recovery, r=petrochenkov 2020-09-02 19:29:27 +00:00
rustc_parse_format
rustc_passes
rustc_plugin_impl
rustc_privacy
rustc_query_system
rustc_resolve Rollup merge of #76143 - jyn514:duplicate-builtin-macros, r=petrochenkov 2020-09-01 18:24:35 -07:00
rustc_save_analysis pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
rustc_serialize
rustc_session Auto merge of #76004 - richkadel:llvm-coverage-map-gen-6b.5, r=tmandry 2020-09-04 01:31:07 +00:00
rustc_span
rustc_symbol_mangling
rustc_target
rustc_trait_selection specialization_graph: avoid trimmed paths for OverlapError 2020-09-03 14:09:50 +03:00
rustc_traits
rustc_ty
rustc_typeck Fix some unwanted uses of Debug formatting on user-facing messages 2020-09-02 10:40:10 +03:00