Skip to content

Commit 8ea0331

Browse files
committed
Adapt code to latest rustc master changes
1 parent 48af59f commit 8ea0331

File tree

3 files changed

+4
-69
lines changed

3 files changed

+4
-69
lines changed

src/librustc_codegen_llvm/debuginfo/metadata.rs

Lines changed: 1 addition & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,13 +1774,7 @@ pub fn create_vtable_metadata(
17741774
llvm::LLVMRustDIBuilderCreateStaticVariable(DIB(cx),
17751775
NO_SCOPE_METADATA,
17761776
name.as_ptr(),
1777-
// LLVM 3.9
1778-
// doesn't accept
1779-
// null here, so
1780-
// pass the name
1781-
// as the linkage
1782-
// name.
1783-
name.as_ptr(),
1777+
ptr::null(),
17841778
unknown_file_metadata(cx),
17851779
UNKNOWN_LINE_NUMBER,
17861780
vtable_type,
@@ -1806,62 +1800,3 @@ pub fn extend_scope_to_file(
18061800
file_metadata)
18071801
}
18081802
}
1809-
1810-
impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx, &'ll Value> {
1811-
1812-
/// Creates debug information for the given vtable, which is for the
1813-
/// given type.
1814-
///
1815-
/// Adds the created metadata nodes directly to the crate's IR.
1816-
fn create_vtable_metadata(
1817-
&self,
1818-
ty: ty::Ty<'tcx>,
1819-
vtable: &'ll Value,
1820-
) {
1821-
if self.dbg_cx.is_none() {
1822-
return;
1823-
}
1824-
1825-
let type_metadata = type_metadata(&self, ty, syntax_pos::DUMMY_SP);
1826-
1827-
unsafe {
1828-
// LLVMRustDIBuilderCreateStructType() wants an empty array. A null
1829-
// pointer will lead to hard to trace and debug LLVM assertions
1830-
// later on in llvm/lib/IR/Value.cpp.
1831-
let empty_array = create_DIArray(DIB(&self), &[]);
1832-
1833-
let name = const_cstr!("vtable");
1834-
1835-
// Create a new one each time. We don't want metadata caching
1836-
// here, because each vtable will refer to a unique containing
1837-
// type.
1838-
let vtable_type = llvm::LLVMRustDIBuilderCreateStructType(
1839-
DIB(&self),
1840-
NO_SCOPE_METADATA,
1841-
name.as_ptr(),
1842-
unknown_file_metadata(&self),
1843-
UNKNOWN_LINE_NUMBER,
1844-
Size::ZERO.bits(),
1845-
self.tcx.data_layout.pointer_align.abi_bits() as u32,
1846-
DIFlags::FlagArtificial,
1847-
None,
1848-
empty_array,
1849-
0,
1850-
Some(type_metadata),
1851-
name.as_ptr()
1852-
);
1853-
1854-
llvm::LLVMRustDIBuilderCreateStaticVariable(DIB(&self),
1855-
NO_SCOPE_METADATA,
1856-
name.as_ptr(),
1857-
ptr::null(),
1858-
unknown_file_metadata(&self),
1859-
UNKNOWN_LINE_NUMBER,
1860-
vtable_type,
1861-
true,
1862-
vtable,
1863-
None,
1864-
0);
1865-
}
1866-
}
1867-
}

src/librustc_codegen_llvm/debuginfo/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,13 +356,13 @@ impl<'ll, 'tcx: 'll> DebugInfoMethods<'ll, 'tcx> for CodegenCx<'ll, 'tcx, &'ll V
356356
let mut flags = DIFlags::FlagPrototyped;
357357

358358
let local_id = self.tcx().hir.as_local_node_id(def_id);
359-
if let Some((id, _, _)) = *cx.sess().entry_fn.borrow() {
359+
if let Some((id, _, _)) = *self.sess().entry_fn.borrow() {
360360
if local_id == Some(id) {
361361
flags |= DIFlags::FlagMainSubprogram;
362362
}
363363
}
364364

365-
if cx.layout_of(sig.output()).abi.is_uninhabited() {
365+
if self.layout_of(sig.output()).abi.is_uninhabited() {
366366
flags |= DIFlags::FlagNoReturn;
367367
}
368368

src/librustc_codegen_llvm/declare.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl DeclareMethods<'ll, 'tcx> for CodegenCx<'ll, 'tcx, &'ll Value> {
146146
let fty = FnType::new(self, sig, &[]);
147147
let llfn = declare_raw_fn(self, name, fty.llvm_cconv(), fty.llvm_type(self));
148148

149-
if self.layout_of(sig.output()).abi == layout::Abi::Uninhabited {
149+
if self.layout_of(sig.output()).abi.is_uninhabited() {
150150
llvm::Attribute::NoReturn.apply_llfn(Function, llfn);
151151
}
152152

0 commit comments

Comments
 (0)