diff options
| author | Patrick Walton <pcwalton@fb.com> | 2022-06-07 13:38:35 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@fb.com> | 2022-06-07 13:38:35 -0700 |
| commit | fe533e862cd2d2d65e14970d327365dfe593aa27 (patch) | |
| tree | 40e05dce398f01f339ea8445ae94a53d52d24286 /compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs | |
| parent | 357bc27904d4a99c83d4b01272c34e0e54934fa5 (diff) | |
| download | rust-fe533e862cd2d2d65e14970d327365dfe593aa27.tar.gz rust-fe533e862cd2d2d65e14970d327365dfe593aa27.zip | |
Specify DWARF alignment in bits, not bytes.
In DWARF, alignment of types is specified in bits, as is made clear by the parameter name `AlignInBits`. However, `rustc` was incorrectly passing a byte alignment. This commit fixes that. This was noticed in upstream LLVM when I tried to check in a test consisting of LLVM IR generated from `rustc` and it triggered assertions [1]. [1]: https://reviews.llvm.org/D126835
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs index dd3adbf70a6..f5cbbc7ca91 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs @@ -1365,7 +1365,7 @@ pub fn build_global_var_di_node<'ll>(cx: &CodegenCx<'ll, '_>, def_id: DefId, glo is_local_to_unit, global, None, - global_align.bytes() as u32, + global_align.bits() as u32, ); } } |
