Use LLVMDIBuilderCreateDebugLocation
The LLVM-C binding takes an explicit context, whereas our binding obtained the context from the scope argument.
This commit is contained in:
parent
949b4673ce
commit
8ddd9c38f6
3 changed files with 9 additions and 17 deletions
|
@ -574,7 +574,7 @@ impl<'ll, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
|
|||
(line, col)
|
||||
};
|
||||
|
||||
unsafe { llvm::LLVMRustDIBuilderCreateDebugLocation(line, col, scope, inlined_at) }
|
||||
unsafe { llvm::LLVMDIBuilderCreateDebugLocation(self.llcx, line, col, scope, inlined_at) }
|
||||
}
|
||||
|
||||
fn create_vtable_debuginfo(
|
||||
|
|
|
@ -1740,6 +1740,14 @@ unsafe extern "C" {
|
|||
File: &'ll Metadata,
|
||||
Discriminator: c_uint, // (optional "DWARF path discriminator"; default is 0)
|
||||
) -> &'ll Metadata;
|
||||
|
||||
pub(crate) fn LLVMDIBuilderCreateDebugLocation<'ll>(
|
||||
Ctx: &'ll Context,
|
||||
Line: c_uint,
|
||||
Column: c_uint,
|
||||
Scope: &'ll Metadata,
|
||||
InlinedAt: Option<&'ll Metadata>,
|
||||
) -> &'ll Metadata;
|
||||
}
|
||||
|
||||
#[link(name = "llvm-wrapper", kind = "static")]
|
||||
|
@ -2302,12 +2310,6 @@ unsafe extern "C" {
|
|||
Params: Option<&'a DIArray>,
|
||||
);
|
||||
|
||||
pub fn LLVMRustDIBuilderCreateDebugLocation<'a>(
|
||||
Line: c_uint,
|
||||
Column: c_uint,
|
||||
Scope: &'a DIScope,
|
||||
InlinedAt: Option<&'a DILocation>,
|
||||
) -> &'a DILocation;
|
||||
pub fn LLVMRustDILocationCloneWithBaseDiscriminator<'a>(
|
||||
Location: &'a DILocation,
|
||||
BD: c_uint,
|
||||
|
|
|
@ -1315,16 +1315,6 @@ extern "C" void LLVMRustDICompositeTypeReplaceArrays(
|
|||
DINodeArray(unwrap<MDTuple>(Params)));
|
||||
}
|
||||
|
||||
extern "C" LLVMMetadataRef
|
||||
LLVMRustDIBuilderCreateDebugLocation(unsigned Line, unsigned Column,
|
||||
LLVMMetadataRef ScopeRef,
|
||||
LLVMMetadataRef InlinedAt) {
|
||||
MDNode *Scope = unwrapDIPtr<MDNode>(ScopeRef);
|
||||
DILocation *Loc = DILocation::get(Scope->getContext(), Line, Column, Scope,
|
||||
unwrapDIPtr<MDNode>(InlinedAt));
|
||||
return wrap(Loc);
|
||||
}
|
||||
|
||||
extern "C" LLVMMetadataRef
|
||||
LLVMRustDILocationCloneWithBaseDiscriminator(LLVMMetadataRef Location,
|
||||
unsigned BD) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue