[llgo] Fix `debug` to use latest `DIBuilder` bindings
Two recent commits to the LLVM Go bindings caused breaking changes
to llgo:
1. r284707 - Moving the `AlignInBits` field from `DIBasicType` to
`DIAutoVariable`.
2. r284482 - The `AlignInBits` fields going from `uint64` to `uint32`.
This commit updates llgo accordingly.
llvm-svn: 288768
GitOrigin-RevId: 7695d8996f5570b178429b06b48155b35047736c
diff --git a/debug/debug.go b/debug/debug.go
index cf5f40b..4331c9c 100644
--- a/debug/debug.go
+++ b/debug/debug.go
@@ -250,14 +250,12 @@
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 @@
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 @@
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 @@
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) 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()}},
})