diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-07-06 10:03:23 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-06 10:03:23 +0200 |
| commit | 6fb00b1514174f215b09afbc574f15f196eb556a (patch) | |
| tree | 9b70264127b960e591d48e6fbca1fcaf13ffcaf6 /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp | |
| parent | 19f8ba4733c3eb8fa98ba06be63df8b621625d0b (diff) | |
| parent | ed3711ea29398b09483e4e2a3930567e9ba81d93 (diff) | |
| download | rust-6fb00b1514174f215b09afbc574f15f196eb556a.tar.gz rust-6fb00b1514174f215b09afbc574f15f196eb556a.zip | |
Rollup merge of #143477 - folkertdev:use-is-multiple-of, r=joshtriplett
use `is_multiple_of` and `div_ceil` In tricky logic, these functions are much more informative than the manual implementations. They also catch subtle bugs: - the manual `is_multiple_of` often does not handle division by zero - manual `div_ceil` often does not consider overflow The transformation is free for `is_multiple_of` if the divisor is compile-time known to be non-zero. For `div_ceil` there is a small cost to considering overflow. Here is some assembly https://godbolt.org/z/5zP8KaE1d.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
