Skip to content

Commit faa3eab

Browse files
committed
Update LLVM to rust-llvm-2015-01-30
1 parent 06126eb commit faa3eab

File tree

5 files changed

+173
-147
lines changed

5 files changed

+173
-147
lines changed

src/librustc_llvm/lib.rs

+10-14
Original file line numberDiff line numberDiff line change
@@ -1843,7 +1843,7 @@ extern {
18431843
Decl: ValueRef)
18441844
-> DIGlobalVariable;
18451845

1846-
pub fn LLVMDIBuilderCreateLocalVariable(Builder: DIBuilderRef,
1846+
pub fn LLVMDIBuilderCreateVariable(Builder: DIBuilderRef,
18471847
Tag: c_uint,
18481848
Scope: DIDescriptor,
18491849
Name: *const c_char,
@@ -1852,6 +1852,8 @@ extern {
18521852
Ty: DIType,
18531853
AlwaysPreserve: bool,
18541854
Flags: c_uint,
1855+
AddrOps: *const ValueRef,
1856+
AddrOpsCount: c_uint,
18551857
ArgNo: c_uint)
18561858
-> DIVariable;
18571859

@@ -1882,12 +1884,16 @@ extern {
18821884
pub fn LLVMDIBuilderInsertDeclareAtEnd(Builder: DIBuilderRef,
18831885
Val: ValueRef,
18841886
VarInfo: DIVariable,
1887+
AddrOps: *const ValueRef,
1888+
AddrOpsCount: c_uint,
18851889
InsertAtEnd: BasicBlockRef)
18861890
-> ValueRef;
18871891

18881892
pub fn LLVMDIBuilderInsertDeclareBefore(Builder: DIBuilderRef,
18891893
Val: ValueRef,
18901894
VarInfo: DIVariable,
1895+
AddrOps: *const ValueRef,
1896+
AddrOpsCount: c_uint,
18911897
InsertBefore: ValueRef)
18921898
-> ValueRef;
18931899

@@ -1935,26 +1941,16 @@ extern {
19351941

19361942
pub fn LLVMDIBuilderCreateOpPlus(IntType: TypeRef) -> ValueRef;
19371943

1938-
pub fn LLVMDIBuilderCreateComplexVariable(Builder: DIBuilderRef,
1939-
Tag: c_uint,
1940-
Scope: ValueRef,
1941-
Name: *const c_char,
1942-
File: ValueRef,
1943-
LineNo: c_uint,
1944-
Ty: ValueRef,
1945-
AddrOps: *const ValueRef,
1946-
AddrOpsCount: c_uint,
1947-
ArgNo: c_uint)
1948-
-> ValueRef;
1949-
19501944
pub fn LLVMDIBuilderCreateNameSpace(Builder: DIBuilderRef,
19511945
Scope: ValueRef,
19521946
Name: *const c_char,
19531947
File: ValueRef,
19541948
LineNo: c_uint)
19551949
-> ValueRef;
19561950

1957-
pub fn LLVMDICompositeTypeSetTypeArray(CompositeType: ValueRef, TypeArray: ValueRef);
1951+
pub fn LLVMDICompositeTypeSetTypeArray(Builder: DIBuilderRef,
1952+
CompositeType: ValueRef,
1953+
TypeArray: ValueRef);
19581954
pub fn LLVMWriteTypeToString(Type: TypeRef, s: RustStringRef);
19591955
pub fn LLVMWriteValueToString(value_ref: ValueRef, s: RustStringRef);
19601956

src/librustc_trans/trans/debuginfo.rs

+19-32
Original file line numberDiff line numberDiff line change
@@ -1699,11 +1699,11 @@ fn declare_local<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
16991699
};
17001700

17011701
let name = CString::from_slice(name.get().as_bytes());
1702-
let (var_alloca, var_metadata) = match variable_access {
1703-
DirectVariable { alloca } => (
1704-
alloca,
1705-
unsafe {
1706-
llvm::LLVMDIBuilderCreateLocalVariable(
1702+
match (variable_access, [].as_slice()) {
1703+
(DirectVariable { alloca }, address_operations) |
1704+
(IndirectVariable {alloca, address_operations}, _) => {
1705+
let metadata = unsafe {
1706+
llvm::LLVMDIBuilderCreateVariable(
17071707
DIB(cx),
17081708
dwarf_tag,
17091709
scope_metadata,
@@ -1713,38 +1713,25 @@ fn declare_local<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
17131713
type_metadata,
17141714
cx.sess().opts.optimize != config::No,
17151715
0,
1716-
argument_index)
1717-
}
1718-
),
1719-
IndirectVariable { alloca, address_operations } => (
1720-
alloca,
1721-
unsafe {
1722-
llvm::LLVMDIBuilderCreateComplexVariable(
1723-
DIB(cx),
1724-
dwarf_tag,
1725-
scope_metadata,
1726-
name.as_ptr(),
1727-
file_metadata,
1728-
loc.line as c_uint,
1729-
type_metadata,
17301716
address_operations.as_ptr(),
17311717
address_operations.len() as c_uint,
17321718
argument_index)
1733-
}
1734-
)
1735-
};
1736-
1737-
set_debug_location(cx, InternalDebugLocation::new(scope_metadata,
1719+
};
1720+
set_debug_location(cx, InternalDebugLocation::new(scope_metadata,
17381721
loc.line,
17391722
loc.col.to_usize()));
1740-
unsafe {
1741-
let instr = llvm::LLVMDIBuilderInsertDeclareAtEnd(
1742-
DIB(cx),
1743-
var_alloca,
1744-
var_metadata,
1745-
bcx.llbb);
1723+
unsafe {
1724+
let instr = llvm::LLVMDIBuilderInsertDeclareAtEnd(
1725+
DIB(cx),
1726+
alloca,
1727+
metadata,
1728+
address_operations.as_ptr(),
1729+
address_operations.len() as c_uint,
1730+
bcx.llbb);
17461731

1747-
llvm::LLVMSetInstDebugLocation(trans::build::B(bcx).llbuilder, instr);
1732+
llvm::LLVMSetInstDebugLocation(trans::build::B(bcx).llbuilder, instr);
1733+
}
1734+
}
17481735
}
17491736

17501737
match variable_kind {
@@ -2716,7 +2703,7 @@ fn set_members_of_composite_type(cx: &CrateContext,
27162703

27172704
unsafe {
27182705
let type_array = create_DIArray(DIB(cx), &member_metadata[]);
2719-
llvm::LLVMDICompositeTypeSetTypeArray(composite_type_metadata, type_array);
2706+
llvm::LLVMDICompositeTypeSetTypeArray(DIB(cx), composite_type_metadata, type_array);
27202707
}
27212708
}
27222709

src/llvm

Submodule llvm updated 4187 files

src/rustllvm/ExecutionEngineWrapper.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ extern "C" LLVMExecutionEngineRef LLVMBuildExecutionEngine(
9494
ExecutionEngine *ee = EngineBuilder(std::move(m))
9595
.setEngineKind(EngineKind::JIT)
9696
.setErrorStr(&error_str)
97-
.setMCJITMemoryManager(mm)
97+
.setMCJITMemoryManager(std::unique_ptr<RTDyldMemoryManager>(mm))
9898
.setTargetOptions(options)
9999
.create();
100100

0 commit comments

Comments
 (0)