about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2025-01-22 19:29:39 +0100
committerGitHub <noreply@github.com>2025-01-22 19:29:39 +0100
commite0d74c0667e0ca2526401bf47052b211e11d6c58 (patch)
treec86dcf0baa231762eb63ddd8b6528a38aa2934f6 /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
parentdf0104086036faac8a8f080572e0b057f507bd52 (diff)
parentd10bdafa26a58356b6aeba18e6e07693157636df (diff)
downloadrust-e0d74c0667e0ca2526401bf47052b211e11d6c58.tar.gz
rust-e0d74c0667e0ca2526401bf47052b211e11d6c58.zip
Rollup merge of #135156 - Zalathar:debuginfo-flags, r=cuviper
Make our `DIFlags` match `LLVMDIFlags` in the LLVM-C API

In order to be able to use a mixture of LLVM-C and C++ bindings for debuginfo, our Rust-side `DIFlags` needs to have the same layout as LLVM-C's `LLVMDIFlags`, and we also need to be able to convert it to the `DIFlags` accepted by LLVM's C++ API.

Internally, LLVM converts between the two types with a simple cast. We can't necessarily rely on that always being true, and LLVM doesn't expose a conversion function, so we have two potential options:
- Convert each bit/subvalue individually
- Statically assert that doing a cast is actually fine

As long as both types do remain the same under the hood (which seems likely), the static-assert-and-cast approach is easier and faster. If the static assertions ever start failing against some future version of LLVM, we'll have to switch over to the convert-each-subvalue approach, which is a bit more error-prone.

---

Extracted from #134009, though this PR ended up choosing the static-assert-and-cast approach over the convert-each-subvalue approach.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions