We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents eb33b43 + 27f92b6 commit b89ee99Copy full SHA for b89ee99
compiler/rustc_codegen_llvm/src/consts.rs
@@ -390,7 +390,7 @@ impl<'ll> CodegenCx<'ll, '_> {
390
let val_llty = self.val_ty(v);
391
392
let g = self.get_static_inner(def_id, val_llty);
393
- let llty = self.val_ty(g);
+ let llty = llvm::LLVMGlobalGetValueType(g);
394
395
let g = if val_llty == llty {
396
g
compiler/rustc_codegen_llvm/src/llvm/ffi.rs
@@ -974,6 +974,7 @@ unsafe extern "C" {
974
pub fn LLVMGetAlignment(Global: &Value) -> c_uint;
975
pub fn LLVMSetAlignment(Global: &Value, Bytes: c_uint);
976
pub fn LLVMSetDLLStorageClass(V: &Value, C: DLLStorageClass);
977
+ pub fn LLVMGlobalGetValueType(Global: &Value) -> &Type;
978
979
// Operations on global variables
980
pub fn LLVMIsAGlobalVariable(GlobalVar: &Value) -> Option<&Value>;
0 commit comments