diff --git a/llgo/debug/debug.go b/llgo/debug/debug.go index cf5f40be7f0a..4331c9cea13c 100644 --- a/llgo/debug/debug.go +++ b/llgo/debug/debug.go @@ -250,14 +250,12 @@ func (d *DIBuilder) descriptorBasic(t *types.Basic, name string) llvm.Metadata { return d.builder.CreateBasicType(llvm.DIBasicType{ Name: name, SizeInBits: uint64(d.sizes.Sizeof(t) * 8), - AlignInBits: uint64(d.sizes.Alignof(t) * 8), Encoding: llvm.DW_ATE_unsigned, }) default: bt := llvm.DIBasicType{ Name: t.String(), SizeInBits: uint64(d.sizes.Sizeof(t) * 8), - AlignInBits: uint64(d.sizes.Alignof(t) * 8), } switch bi := t.Info(); { case bi&types.IsBoolean != 0: @@ -283,7 +281,7 @@ func (d *DIBuilder) descriptorPointer(t *types.Pointer) llvm.Metadata { return d.builder.CreatePointerType(llvm.DIPointerType{ Pointee: d.DIType(t.Elem()), SizeInBits: uint64(d.sizes.Sizeof(t) * 8), - AlignInBits: uint64(d.sizes.Alignof(t) * 8), + AlignInBits: uint32(d.sizes.Alignof(t) * 8), }) } @@ -301,7 +299,7 @@ func (d *DIBuilder) descriptorStruct(t *types.Struct, name string) llvm.Metadata Name: f.Name(), Type: d.DIType(t), SizeInBits: uint64(d.sizes.Sizeof(t) * 8), - AlignInBits: uint64(d.sizes.Alignof(t) * 8), + AlignInBits: uint32(d.sizes.Alignof(t) * 8), OffsetInBits: uint64(offsets[i] * 8), }) } @@ -309,7 +307,7 @@ func (d *DIBuilder) descriptorStruct(t *types.Struct, name string) llvm.Metadata return d.builder.CreateStructType(d.cu, llvm.DIStructType{ Name: name, SizeInBits: uint64(d.sizes.Sizeof(t) * 8), - AlignInBits: uint64(d.sizes.Alignof(t) * 8), + AlignInBits: uint32(d.sizes.Alignof(t) * 8), Elements: members, }) } @@ -345,7 +343,7 @@ func (d *DIBuilder) descriptorNamed(t *types.Named) llvm.Metadata { func (d *DIBuilder) descriptorArray(t *types.Array, name string) llvm.Metadata { return d.builder.CreateArrayType(llvm.DIArrayType{ SizeInBits: uint64(d.sizes.Sizeof(t) * 8), - AlignInBits: uint64(d.sizes.Alignof(t) * 8), + AlignInBits: uint32(d.sizes.Alignof(t) * 8), ElementType: d.DIType(t.Elem()), Subscripts: []llvm.DISubrange{{Count: t.Len()}}, })