RustWrapper: adapt for an LLVM API change
No functional changes intended.
The LLVM commit
ec501f15a8
removed the signed version of `createExpression`. This adapts the Rust
LLVM wrappers accordingly.
This commit is contained in:
parent
b5da80871d
commit
4ce56b414d
3 changed files with 10 additions and 10 deletions
|
@ -160,17 +160,17 @@ impl<'ll> DebugInfoBuilderMethods for Builder<'_, 'll, '_> {
|
||||||
// the values should match the ones in the DWARF standard anyway.
|
// the values should match the ones in the DWARF standard anyway.
|
||||||
let op_deref = || unsafe { llvm::LLVMRustDIBuilderCreateOpDeref() };
|
let op_deref = || unsafe { llvm::LLVMRustDIBuilderCreateOpDeref() };
|
||||||
let op_plus_uconst = || unsafe { llvm::LLVMRustDIBuilderCreateOpPlusUconst() };
|
let op_plus_uconst = || unsafe { llvm::LLVMRustDIBuilderCreateOpPlusUconst() };
|
||||||
let mut addr_ops = SmallVec::<[_; 8]>::new();
|
let mut addr_ops = SmallVec::<[u64; 8]>::new();
|
||||||
|
|
||||||
if direct_offset.bytes() > 0 {
|
if direct_offset.bytes() > 0 {
|
||||||
addr_ops.push(op_plus_uconst());
|
addr_ops.push(op_plus_uconst());
|
||||||
addr_ops.push(direct_offset.bytes() as i64);
|
addr_ops.push(direct_offset.bytes() as u64);
|
||||||
}
|
}
|
||||||
for &offset in indirect_offsets {
|
for &offset in indirect_offsets {
|
||||||
addr_ops.push(op_deref());
|
addr_ops.push(op_deref());
|
||||||
if offset.bytes() > 0 {
|
if offset.bytes() > 0 {
|
||||||
addr_ops.push(op_plus_uconst());
|
addr_ops.push(op_plus_uconst());
|
||||||
addr_ops.push(offset.bytes() as i64);
|
addr_ops.push(offset.bytes() as u64);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2108,7 +2108,7 @@ extern "C" {
|
||||||
Builder: &DIBuilder<'a>,
|
Builder: &DIBuilder<'a>,
|
||||||
Val: &'a Value,
|
Val: &'a Value,
|
||||||
VarInfo: &'a DIVariable,
|
VarInfo: &'a DIVariable,
|
||||||
AddrOps: *const i64,
|
AddrOps: *const u64,
|
||||||
AddrOpsCount: c_uint,
|
AddrOpsCount: c_uint,
|
||||||
DL: &'a DILocation,
|
DL: &'a DILocation,
|
||||||
InsertAtEnd: &'a BasicBlock,
|
InsertAtEnd: &'a BasicBlock,
|
||||||
|
@ -2199,8 +2199,8 @@ extern "C" {
|
||||||
Scope: &'a DIScope,
|
Scope: &'a DIScope,
|
||||||
InlinedAt: Option<&'a DILocation>,
|
InlinedAt: Option<&'a DILocation>,
|
||||||
) -> &'a DILocation;
|
) -> &'a DILocation;
|
||||||
pub fn LLVMRustDIBuilderCreateOpDeref() -> i64;
|
pub fn LLVMRustDIBuilderCreateOpDeref() -> u64;
|
||||||
pub fn LLVMRustDIBuilderCreateOpPlusUconst() -> i64;
|
pub fn LLVMRustDIBuilderCreateOpPlusUconst() -> u64;
|
||||||
|
|
||||||
#[allow(improper_ctypes)]
|
#[allow(improper_ctypes)]
|
||||||
pub fn LLVMRustWriteTypeToString(Type: &Type, s: &RustString);
|
pub fn LLVMRustWriteTypeToString(Type: &Type, s: &RustString);
|
||||||
|
|
|
@ -979,11 +979,11 @@ LLVMRustDIBuilderGetOrCreateArray(LLVMRustDIBuilderRef Builder,
|
||||||
|
|
||||||
extern "C" LLVMValueRef LLVMRustDIBuilderInsertDeclareAtEnd(
|
extern "C" LLVMValueRef LLVMRustDIBuilderInsertDeclareAtEnd(
|
||||||
LLVMRustDIBuilderRef Builder, LLVMValueRef V, LLVMMetadataRef VarInfo,
|
LLVMRustDIBuilderRef Builder, LLVMValueRef V, LLVMMetadataRef VarInfo,
|
||||||
int64_t *AddrOps, unsigned AddrOpsCount, LLVMMetadataRef DL,
|
uint64_t *AddrOps, unsigned AddrOpsCount, LLVMMetadataRef DL,
|
||||||
LLVMBasicBlockRef InsertAtEnd) {
|
LLVMBasicBlockRef InsertAtEnd) {
|
||||||
return wrap(Builder->insertDeclare(
|
return wrap(Builder->insertDeclare(
|
||||||
unwrap(V), unwrap<DILocalVariable>(VarInfo),
|
unwrap(V), unwrap<DILocalVariable>(VarInfo),
|
||||||
Builder->createExpression(llvm::ArrayRef<int64_t>(AddrOps, AddrOpsCount)),
|
Builder->createExpression(llvm::ArrayRef<uint64_t>(AddrOps, AddrOpsCount)),
|
||||||
DebugLoc(cast<MDNode>(unwrap(DL))),
|
DebugLoc(cast<MDNode>(unwrap(DL))),
|
||||||
unwrap(InsertAtEnd)));
|
unwrap(InsertAtEnd)));
|
||||||
}
|
}
|
||||||
|
@ -1057,11 +1057,11 @@ LLVMRustDIBuilderCreateDebugLocation(unsigned Line, unsigned Column,
|
||||||
return wrap(Loc);
|
return wrap(Loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" int64_t LLVMRustDIBuilderCreateOpDeref() {
|
extern "C" uint64_t LLVMRustDIBuilderCreateOpDeref() {
|
||||||
return dwarf::DW_OP_deref;
|
return dwarf::DW_OP_deref;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" int64_t LLVMRustDIBuilderCreateOpPlusUconst() {
|
extern "C" uint64_t LLVMRustDIBuilderCreateOpPlusUconst() {
|
||||||
return dwarf::DW_OP_plus_uconst;
|
return dwarf::DW_OP_plus_uconst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue