about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-06-08 13:43:19 +0200
committerGitHub <noreply@github.com>2022-06-08 13:43:19 +0200
commit82a1d79dffd5e6ba86271046f795a4235d734845 (patch)
treea505e884701454c9f93bf5165b8edae21e4140d3 /compiler/rustc_codegen_llvm
parent29c6f5f60322663349f0a167fedc7240f498dd7b (diff)
parentfe533e862cd2d2d65e14970d327365dfe593aa27 (diff)
downloadrust-82a1d79dffd5e6ba86271046f795a4235d734845.tar.gz
rust-82a1d79dffd5e6ba86271046f795a4235d734845.zip
Rollup merge of #97846 - pcwalton:align-bits, r=michaelwoerister
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')
-rw-r--r--compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs2
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,
         );
     }
 }