Use LLVMDIBuilderCreateGlobalVariableExpression
Note that the code in `LLVMRustDIBuilderCreateStaticVariable` that tried to downcast `InitVal` appears to have been dead, because `llvm::ConstantInt` and `llvm::ConstantFP` are not subclasses of `llvm::GlobalVariable`.
This commit is contained in:
@@ -22,9 +22,9 @@ use libc::{c_char, c_int, c_uchar, c_uint, c_ulonglong, c_void, size_t};
|
||||
|
||||
use super::RustString;
|
||||
use super::debuginfo::{
|
||||
DIArray, DIBuilder, DIDerivedType, DIDescriptor, DIEnumerator, DIFile, DIFlags,
|
||||
DIGlobalVariableExpression, DILocation, DISPFlags, DIScope, DISubprogram,
|
||||
DITemplateTypeParameter, DIType, DebugEmissionKind, DebugNameTableKind,
|
||||
DIArray, DIBuilder, DIDerivedType, DIDescriptor, DIEnumerator, DIFile, DIFlags, DILocation,
|
||||
DISPFlags, DIScope, DISubprogram, DITemplateTypeParameter, DIType, DebugEmissionKind,
|
||||
DebugNameTableKind,
|
||||
};
|
||||
use crate::llvm::MetadataKindId;
|
||||
use crate::{TryFromU32, llvm};
|
||||
@@ -781,7 +781,6 @@ pub(crate) mod debuginfo {
|
||||
pub(crate) type DIDerivedType = DIType;
|
||||
pub(crate) type DICompositeType = DIDerivedType;
|
||||
pub(crate) type DIVariable = DIDescriptor;
|
||||
pub(crate) type DIGlobalVariableExpression = DIDescriptor;
|
||||
pub(crate) type DIArray = DIDescriptor;
|
||||
pub(crate) type DIEnumerator = DIDescriptor;
|
||||
pub(crate) type DITemplateTypeParameter = DIDescriptor;
|
||||
@@ -1875,6 +1874,22 @@ unsafe extern "C" {
|
||||
Length: size_t,
|
||||
) -> &'ll Metadata;
|
||||
|
||||
pub(crate) fn LLVMDIBuilderCreateGlobalVariableExpression<'ll>(
|
||||
Builder: &DIBuilder<'ll>,
|
||||
Scope: Option<&'ll Metadata>,
|
||||
Name: *const c_uchar, // See "PTR_LEN_STR".
|
||||
NameLen: size_t,
|
||||
Linkage: *const c_uchar, // See "PTR_LEN_STR".
|
||||
LinkLen: size_t,
|
||||
File: &'ll Metadata,
|
||||
LineNo: c_uint,
|
||||
Ty: &'ll Metadata,
|
||||
LocalToUnit: llvm::Bool,
|
||||
Expr: &'ll Metadata,
|
||||
Decl: Option<&'ll Metadata>,
|
||||
AlignInBits: u32,
|
||||
) -> &'ll Metadata;
|
||||
|
||||
pub(crate) fn LLVMDIBuilderInsertDeclareRecordAtEnd<'ll>(
|
||||
Builder: &DIBuilder<'ll>,
|
||||
Storage: &'ll Value,
|
||||
@@ -2214,22 +2229,6 @@ unsafe extern "C" {
|
||||
Ty: &'a DIType,
|
||||
) -> &'a DIType;
|
||||
|
||||
pub(crate) fn LLVMRustDIBuilderCreateStaticVariable<'a>(
|
||||
Builder: &DIBuilder<'a>,
|
||||
Context: Option<&'a DIScope>,
|
||||
Name: *const c_char,
|
||||
NameLen: size_t,
|
||||
LinkageName: *const c_char,
|
||||
LinkageNameLen: size_t,
|
||||
File: &'a DIFile,
|
||||
LineNo: c_uint,
|
||||
Ty: &'a DIType,
|
||||
isLocalToUnit: bool,
|
||||
Val: &'a Value,
|
||||
Decl: Option<&'a DIDescriptor>,
|
||||
AlignInBits: u32,
|
||||
) -> &'a DIGlobalVariableExpression;
|
||||
|
||||
pub(crate) fn LLVMRustDIBuilderCreateEnumerator<'a>(
|
||||
Builder: &DIBuilder<'a>,
|
||||
Name: *const c_char,
|
||||
|
||||
Reference in New Issue
Block a user