mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-21 22:34:05 +00:00
fix: get llvm type of global val
This commit is contained in:
parent
9337f7afa6
commit
27f92b6c10
@ -390,7 +390,7 @@ impl<'ll> CodegenCx<'ll, '_> {
|
||||
let val_llty = self.val_ty(v);
|
||||
|
||||
let g = self.get_static_inner(def_id, val_llty);
|
||||
let llty = self.val_ty(g);
|
||||
let llty = llvm::LLVMGlobalGetValueType(g);
|
||||
|
||||
let g = if val_llty == llty {
|
||||
g
|
||||
|
@ -974,6 +974,7 @@ extern "C" {
|
||||
pub fn LLVMGetAlignment(Global: &Value) -> c_uint;
|
||||
pub fn LLVMSetAlignment(Global: &Value, Bytes: c_uint);
|
||||
pub fn LLVMSetDLLStorageClass(V: &Value, C: DLLStorageClass);
|
||||
pub fn LLVMGlobalGetValueType(Global: &Value) -> &Type;
|
||||
|
||||
// Operations on global variables
|
||||
pub fn LLVMIsAGlobalVariable(GlobalVar: &Value) -> Option<&Value>;
|
||||
|
Loading…
Reference in New Issue
Block a user