Skip to content

Commit 40e7667

Browse files
committed
Remove LLVM 3.9 workaround.
1 parent dfabe4b commit 40e7667

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

src/librustc_codegen_llvm/debuginfo/metadata.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -1803,13 +1803,7 @@ pub fn create_vtable_metadata(
18031803
llvm::LLVMRustDIBuilderCreateStaticVariable(DIB(cx),
18041804
NO_SCOPE_METADATA,
18051805
name.as_ptr(),
1806-
// LLVM 3.9
1807-
// doesn't accept
1808-
// null here, so
1809-
// pass the name
1810-
// as the linkage
1811-
// name.
1812-
name.as_ptr(),
1806+
ptr::null(),
18131807
unknown_file_metadata(cx),
18141808
UNKNOWN_LINE_NUMBER,
18151809
vtable_type,

src/librustc_codegen_llvm/llvm/ffi.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// FIXME: Rename 'DIGlobalVariable' to 'DIGlobalVariableExpression'
12-
// once support for LLVM 3.9 is dropped.
13-
//
14-
// This method was changed in this LLVM patch:
15-
// https://reviews.llvm.org/D26769
16-
1711
use super::debuginfo::{
1812
DIBuilder, DIDescriptor, DIFile, DILexicalBlock, DISubprogram, DIType,
1913
DIBasicType, DIDerivedType, DICompositeType, DIScope, DIVariable,
20-
DIGlobalVariable, DIArray, DISubrange, DITemplateTypeParameter, DIEnumerator,
14+
DIGlobalVariableExpression, DIArray, DISubrange, DITemplateTypeParameter, DIEnumerator,
2115
DINameSpace, DIFlags,
2216
};
2317

@@ -447,7 +441,7 @@ pub mod debuginfo {
447441
pub type DIDerivedType = DIType;
448442
pub type DICompositeType = DIDerivedType;
449443
pub type DIVariable = DIDescriptor;
450-
pub type DIGlobalVariable = DIDescriptor;
444+
pub type DIGlobalVariableExpression = DIDescriptor;
451445
pub type DIArray = DIDescriptor;
452446
pub type DISubrange = DIDescriptor;
453447
pub type DIEnumerator = DIDescriptor;
@@ -1330,7 +1324,7 @@ extern "C" {
13301324
Val: &'a Value,
13311325
Decl: Option<&'a DIDescriptor>,
13321326
AlignInBits: u32)
1333-
-> &'a DIGlobalVariable;
1327+
-> &'a DIGlobalVariableExpression;
13341328

13351329
pub fn LLVMRustDIBuilderCreateVariable(Builder: &DIBuilder<'a>,
13361330
Tag: c_uint,

0 commit comments

Comments
 (0)