[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
This commit is contained in:
Meador Inge 2016-12-06 04:00:12 +00:00
parent b486c49ff5
commit 7695d8996f
1 changed files with 4 additions and 6 deletions

View File

@ -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()}},
})