mirror of
https://github.com/ziglang/zig.git
synced 2025-12-16 11:13:08 +00:00
fix vector debug info tripping LLVM assertion
This commit is contained in:
parent
8c6fa982cd
commit
06be65a602
@ -4486,8 +4486,9 @@ ZigType *get_vector_type(CodeGen *g, uint32_t len, ZigType *elem_type) {
|
||||
buf_resize(&entry->name, 0);
|
||||
buf_appendf(&entry->name, "@Vector(%u, %s)", len, buf_ptr(&elem_type->name));
|
||||
|
||||
entry->di_type = ZigLLVMDIBuilderCreateVectorType(g->dbuilder, len,
|
||||
LLVMABIAlignmentOfType(g->target_data_ref, entry->type_ref), elem_type->di_type);
|
||||
entry->di_type = ZigLLVMDIBuilderCreateVectorType(g->dbuilder,
|
||||
len * type_size_bits(g, elem_type),
|
||||
LLVMABIAlignmentOfType(g->target_data_ref, entry->type_ref), elem_type->di_type, len);
|
||||
|
||||
g->type_table.put(type_id, entry);
|
||||
return entry;
|
||||
|
||||
@ -264,12 +264,12 @@ ZigLLVMDIType *ZigLLVMCreateDebugBasicType(ZigLLVMDIBuilder *dibuilder, const ch
|
||||
}
|
||||
|
||||
struct ZigLLVMDIType *ZigLLVMDIBuilderCreateVectorType(struct ZigLLVMDIBuilder *dibuilder,
|
||||
uint64_t Size, uint32_t AlignInBits, struct ZigLLVMDIType *Ty)
|
||||
uint64_t SizeInBits, uint32_t AlignInBits, struct ZigLLVMDIType *Ty, uint32_t elem_count)
|
||||
{
|
||||
SmallVector<Metadata *, 1> subrange;
|
||||
subrange.push_back(reinterpret_cast<DIBuilder*>(dibuilder)->getOrCreateSubrange(0, Size));
|
||||
subrange.push_back(reinterpret_cast<DIBuilder*>(dibuilder)->getOrCreateSubrange(0, elem_count));
|
||||
DIType *di_type = reinterpret_cast<DIBuilder*>(dibuilder)->createVectorType(
|
||||
Size,
|
||||
SizeInBits,
|
||||
AlignInBits,
|
||||
reinterpret_cast<DIType*>(Ty),
|
||||
reinterpret_cast<DIBuilder*>(dibuilder)->getOrCreateArray(subrange));
|
||||
|
||||
@ -192,7 +192,7 @@ ZIG_EXTERN_C struct ZigLLVMDISubprogram *ZigLLVMCreateFunction(struct ZigLLVMDIB
|
||||
unsigned scope_line, unsigned flags, bool is_optimized, struct ZigLLVMDISubprogram *decl_subprogram);
|
||||
|
||||
ZIG_EXTERN_C struct ZigLLVMDIType *ZigLLVMDIBuilderCreateVectorType(struct ZigLLVMDIBuilder *dibuilder,
|
||||
uint64_t Size, uint32_t AlignInBits, struct ZigLLVMDIType *Ty);
|
||||
uint64_t SizeInBits, uint32_t AlignInBits, struct ZigLLVMDIType *Ty, uint32_t elem_count);
|
||||
|
||||
ZIG_EXTERN_C void ZigLLVMFnSetSubprogram(LLVMValueRef fn, struct ZigLLVMDISubprogram *subprogram);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user