fn create_struct_stub(
    cx: &CodegenCx<'ll, 'tcx>,
    struct_type: Ty<'tcx>,
    struct_type_name: &str,
    unique_type_id: UniqueTypeId,
    containing_scope: Option<&'ll DIScope>,
) -> &'ll DICompositeType {
    let (struct_size, struct_align) = cx.size_and_align_of(struct_type);

    let name = SmallCStr::new(struct_type_name);
    let unique_type_id = SmallCStr::new(
        debug_context(cx).type_map.borrow().get_unique_type_id_as_string(unique_type_id)
    );
    let metadata_stub = unsafe {
        // LLVMRustDIBuilderCreateStructType() wants an empty array. A null
        // pointer will lead to hard to trace and debug LLVM assertions
        // later on in llvm/lib/IR/Value.cpp.
        let empty_array = create_DIArray(DIB(cx), &[]);

        llvm::LLVMRustDIBuilderCreateStructType(
            DIB(cx),
            containing_scope,
            name.as_ptr(),
            unknown_file_metadata(cx),
            UNKNOWN_LINE_NUMBER,
            struct_size.bits(),
            struct_align.abi_bits() as u32,
            DIFlags::FlagZero,
            None,
            empty_array,
            0,
            None,
            unique_type_id.as_ptr())
    };

    return metadata_stub;
}
// A convenience wrapper around LLVMRustDIBuilderCreateStructType(). Does not do
// any caching, does not add any fields to the struct. This can be done later
// with set_members_of_composite_type().
A convenience wrapper around LLVMRustDIBuilderCreateStructType(). Does not do
any caching, does not add any fields to the struct. This can be done later
with set_members_of_composite_type().
A convenience wrapper around LLVMRustDIBuilderCreateStructType () . Does not do any caching does not add any fields to the struct . This can be done later with set_members_of_composite_type () .
fn create_struct_stub(
    cx: &CodegenCx<'ll, 'tcx>,
    struct_type: Ty<'tcx>,
    struct_type_name: &str,
    unique_type_id: UniqueTypeId,
    containing_scope: Option<&'ll DIScope>,
) -> &'ll DICompositeType {
    let (struct_size, struct_align) = cx.size_and_align_of(struct_type);
    let name = SmallCStr::new(struct_type_name);
    let unique_type_id = SmallCStr::new(
        debug_context(cx).type_map.borrow().get_unique_type_id_as_string(unique_type_id)
    );
    let metadata_stub = unsafe {
        // LLVMRustDIBuilderCreateStructType() wants an empty array. A null
        // pointer will lead to hard to trace and debug LLVM assertions
        // later on in llvm/lib/IR/Value.cpp.
        let empty_array = create_DIArray(DIB(cx), &[]);
        llvm::LLVMRustDIBuilderCreateStructType(
            DIB(cx),
            containing_scope,
            name.as_ptr(),
            unknown_file_metadata(cx),
            UNKNOWN_LINE_NUMBER,
            struct_size.bits(),
            struct_align.abi_bits() as u32,
            DIFlags::FlagZero,
            None,
            empty_array,
            0,
            None,
            unique_type_id.as_ptr())
    };
    return metadata_stub;
}
fn create_struct_stub ( cx : & CodegenCx < ' ll , ' tcx > , struct_type : Ty < ' tcx > , struct_type_name : & str , unique_type_id : UniqueTypeId , containing_scope : Option < & ' ll DIScope > , ) -> & ' ll DICompositeType { let ( struct_size , struct_align ) = cx . size_and_align_of ( struct_type ) ; let name = SmallCStr :: new ( struct_type_name ) ; let unique_type_id = SmallCStr :: new ( debug_context ( cx ) . type_map . borrow ( ) . get_unique_type_id_as_string ( unique_type_id ) ) ; let metadata_stub = unsafe { // LLVMRustDIBuilderCreateStructType() wants an empty array. A null // pointer will lead to hard to trace and debug LLVM assertions // later on in llvm/lib/IR/Value.cpp. let empty_array = create_DIArray ( DIB ( cx ) , & [ ] ) ; llvm :: LLVMRustDIBuilderCreateStructType ( DIB ( cx ) , containing_scope , name . as_ptr ( ) , unknown_file_metadata ( cx ) , UNKNOWN_LINE_NUMBER , struct_size . bits ( ) , struct_align . abi_bits ( ) as u32 , DIFlags :: FlagZero , None , empty_array , 0 , None , unique_type_id . as_ptr ( ) ) } ; return metadata_stub ; }
A convenience wrapper around LLVMRustDIBuilderCreateStructType().
A convenience wrapper around LLVMRustDIBuilderCreateStructType () .
cx
&CodegenCx<'ll, 'tcx>
struct_type
Ty<'tcx>
struct_type_name
&str
unique_type_id
UniqueTypeId
containing_scope
Option<&'ll DIScope>
cx
&CodegenCx<'ll, 'tcx>
struct_type
Ty<'tcx>
struct_type_name
&str
unique_type_id
UniqueTypeId
containing_scope
Option<&'ll DIScope>