1. 20 8月, 2020 2 次提交
  2. 19 8月, 2020 1 次提交
  3. 18 8月, 2020 2 次提交
  4. 17 8月, 2020 1 次提交
  5. 15 8月, 2020 2 次提交
    • T
      MatchBranchSimplification: fix equal const bool assignments · 1fe2e294
      Tomasz Miąsko 提交于
      The match branch simplification is applied when target blocks contain
      statements that are either equal or perform a const bool assignment with
      different values to the same place.
      
      Previously, when constructing new statements, only statements from a
      single block had been examined. This lead to a misoptimization when
      statements are equal because the assign the *same* const bool value to
      the same place.
      
      Fix the issue by examining statements from both blocks when deciding on
      replacement.
      1fe2e294
    • T
      MatchBranchSimplification: copy discriminant instead of moving it · 4fae0496
      Tomasz Miąsko 提交于
      It might be necessary to use its value more than once.
      4fae0496
  6. 14 8月, 2020 2 次提交
    • K
      Add fix · fd740266
      kadmin 提交于
      This also explicitly checks that the types are `bool`. `try_eval_bool` also appears to just
      succeed for `u8`, so this ensures that it actually is a bool before casting.
      fd740266
    • K
      Add regression test for matching on u8 · c0a811a2
      kadmin 提交于
      c0a811a2
  7. 13 8月, 2020 4 次提交
  8. 11 8月, 2020 1 次提交
  9. 10 8月, 2020 1 次提交
  10. 05 8月, 2020 1 次提交
    • R
      Completes support for coverage in external crates · e0dc8dec
      Rich Kadel 提交于
      The prior PR corrected for errors encountered when trying to generate
      the coverage map on source code inlined from external crates (including
      macros and generics) by avoiding adding external DefIds to the coverage
      map.
      
      This made it possible to generate a coverage report including external
      crates, but the external crate coverage was incomplete (did not include
      coverage for the DefIds that were eliminated.
      
      The root issue was that the coverage map was converting Span locations
      to source file and locations, using the SourceMap for the current crate,
      and this would not work for spans from external crates (compliled with a
      different SourceMap).
      
      The solution was to convert the Spans to filename and location during
      MIR generation instead, so precompiled external crates would already
      have the correct source code locations embedded in their MIR, when
      imported into another crate.
      e0dc8dec
  11. 31 7月, 2020 1 次提交
  12. 30 7月, 2020 3 次提交
  13. 29 7月, 2020 2 次提交
  14. 28 7月, 2020 1 次提交
  15. 24 7月, 2020 1 次提交
  16. 22 7月, 2020 2 次提交
  17. 18 7月, 2020 1 次提交
    • R
      Generating the coverage map · a6f8b8a2
      Rich Kadel 提交于
      rustc now generates the coverage map and can support (limited)
      coverage report generation, at the function level.
      
      Example:
      
      $ BUILD=$HOME/rust/build/x86_64-unknown-linux-gnu
      $ $BUILD/stage1/bin/rustc -Zinstrument-coverage \
      $HOME/rust/src/test/run-make-fulldeps/instrument-coverage/main.rs
      $ LLVM_PROFILE_FILE="main.profraw" ./main
      called
      $ $BUILD/llvm/bin/llvm-profdata merge -sparse main.profraw -o main.profdata
      $ $BUILD/llvm/bin/llvm-cov show --instr-profile=main.profdata main
          1|      1|pub fn will_be_called() {
          2|      1|    println!("called");
          3|      1|}
          4|       |
          5|      0|pub fn will_not_be_called() {
          6|      0|    println!("should not have been called");
          7|      0|}
          8|       |
          9|      1|fn main() {
         10|      1|    let less = 1;
         11|      1|    let more = 100;
         12|      1|
         13|      1|    if less < more {
         14|      1|        will_be_called();
         15|      1|    } else {
         16|      1|        will_not_be_called();
         17|      1|    }
         18|      1|}
      a6f8b8a2
  18. 17 7月, 2020 2 次提交
  19. 15 7月, 2020 3 次提交
  20. 08 7月, 2020 1 次提交
  21. 03 7月, 2020 3 次提交
  22. 01 7月, 2020 1 次提交
  23. 30 6月, 2020 1 次提交
    • R
      add spans to injected coverage counters · 5239a68e
      Rich Kadel 提交于
      added regions with counter expressions and counters.
      
      Added codegen_llvm/coverageinfo mod for upcoming coverage map
      
      Move coverage region collection to CodegenCx finalization
      
      Moved from `query coverageinfo` (renamed from `query coverage_data`),
      as discussed in the PR at:
      
      https://github.com/rust-lang/rust/pull/73684#issuecomment-649882503
      
      Address merge conflict in MIR instrument_coverage test
      
      The MIR test output format changed for int types.
      
      moved debug messages out of block.rs
      
      This makes the block.rs calls to add coverage mapping data to the
      CodegenCx much more concise and readable.
      
      move coverage intrinsic handling into llvm impl
      
      I realized that having half of the coverage intrinsic handling in
      `rustc_codegen_ssa` and half in `rustc_codegen_llvm` meant that any
      non-llvm backend would be bound to the same decisions about how the
      coverage-related MIR terminators should be handled.
      
      To fix this, I moved the non-codegen portion of coverage intrinsic
      handling into its own trait, and implemented it in `rustc_codegen_llvm`
      alongside `codegen_intrinsic_call`.
      
      I also added the (required?) stubs for the new intrinsics to
      `IntrepretCx::emulate_intrinsic()`, to ensure calls to this function do
      not fail if called with these new but known intrinsics.
      
      address PR Feedback on 28 June 2020 2:48pm PDT
      5239a68e
  24. 26 6月, 2020 1 次提交