@@ -68,7 +68,6 @@ pub const UNKNOWN_LINE_NUMBER: c_uint = 0;
68
68
pub const UNKNOWN_COLUMN_NUMBER : c_uint = 0 ;
69
69
70
70
// ptr::null() doesn't work :(
71
- pub const NO_FILE_METADATA : DIFile = ( 0 as DIFile ) ;
72
71
pub const NO_SCOPE_METADATA : DIScope = ( 0 as DIScope ) ;
73
72
74
73
const FLAGS_NONE : c_uint = 0 ;
@@ -616,7 +615,7 @@ fn subroutine_type_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
616
615
unsafe {
617
616
llvm:: LLVMDIBuilderCreateSubroutineType (
618
617
DIB ( cx) ,
619
- NO_FILE_METADATA ,
618
+ unknown_file_metadata ( cx ) ,
620
619
create_DIArray ( DIB ( cx) , & signature_metadata[ ..] ) )
621
620
} ,
622
621
false ) ;
@@ -653,14 +652,15 @@ fn trait_pointer_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
653
652
let ( containing_scope, _) = get_namespace_and_span_for_item ( cx, def_id) ;
654
653
655
654
let trait_llvm_type = type_of:: type_of ( cx, trait_object_type) ;
655
+ let file_metadata = unknown_file_metadata ( cx) ;
656
656
657
657
composite_type_metadata ( cx,
658
658
trait_llvm_type,
659
659
& trait_type_name[ ..] ,
660
660
unique_type_id,
661
661
& [ ] ,
662
662
containing_scope,
663
- NO_FILE_METADATA ,
663
+ file_metadata ,
664
664
syntax_pos:: DUMMY_SP )
665
665
}
666
666
@@ -1628,7 +1628,7 @@ fn prepare_enum_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
1628
1628
DIB ( cx) ,
1629
1629
containing_scope,
1630
1630
name. as_ptr ( ) ,
1631
- NO_FILE_METADATA ,
1631
+ file_metadata ,
1632
1632
UNKNOWN_LINE_NUMBER ,
1633
1633
bytes_to_bits ( discriminant_size) ,
1634
1634
bytes_to_bits ( discriminant_align) ,
@@ -1774,7 +1774,7 @@ fn set_members_of_composite_type(cx: &CrateContext,
1774
1774
DIB ( cx) ,
1775
1775
composite_type_metadata,
1776
1776
member_name. as_ptr ( ) ,
1777
- NO_FILE_METADATA ,
1777
+ unknown_file_metadata ( cx ) ,
1778
1778
UNKNOWN_LINE_NUMBER ,
1779
1779
bytes_to_bits ( member_size) ,
1780
1780
bytes_to_bits ( member_align) ,
@@ -1817,7 +1817,7 @@ fn create_struct_stub(cx: &CrateContext,
1817
1817
DIB ( cx) ,
1818
1818
containing_scope,
1819
1819
name. as_ptr ( ) ,
1820
- NO_FILE_METADATA ,
1820
+ unknown_file_metadata ( cx ) ,
1821
1821
UNKNOWN_LINE_NUMBER ,
1822
1822
bytes_to_bits ( struct_size) ,
1823
1823
bytes_to_bits ( struct_align) ,
@@ -1857,7 +1857,7 @@ pub fn create_global_var_metadata(cx: &CrateContext,
1857
1857
let loc = span_start ( cx, span) ;
1858
1858
( file_metadata ( cx, & loc. file . name , & loc. file . abs_path ) , loc. line as c_uint )
1859
1859
} else {
1860
- ( NO_FILE_METADATA , UNKNOWN_LINE_NUMBER )
1860
+ ( unknown_file_metadata ( cx ) , UNKNOWN_LINE_NUMBER )
1861
1861
} ;
1862
1862
1863
1863
let is_local_to_unit = is_node_local_to_unit ( cx, node_id) ;
0 commit comments