From 4a447f5c128abf644317c232f6352b2e933f48ef Mon Sep 17 00:00:00 2001 From: Li Jie Date: Sun, 15 Sep 2024 10:48:37 +0800 Subject: [PATCH] cover integers, floats, bool, array, complex --- cl/_testdata/debug/in.go | 16 ++++++++++++++++ ssa/di.go | 3 +-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/cl/_testdata/debug/in.go b/cl/_testdata/debug/in.go index be79647d..c89e7e9d 100644 --- a/cl/_testdata/debug/in.go +++ b/cl/_testdata/debug/in.go @@ -7,6 +7,22 @@ type IFoo interface { type Foo struct { nexy *Foo data map[string]uint64 + f32 float32 + f64 float64 + u8 uint8 + u16 uint16 + u32 uint32 + u64 uint64 + u uint + i8 int8 + i16 int16 + i32 int32 + i64 int64 + i int + b bool + arr [10]int + c64 complex64 + c128 complex128 } func (Foo) Foo(a []int, b string) int { diff --git a/ssa/di.go b/ssa/di.go index c00a3117..1f669734 100644 --- a/ssa/di.go +++ b/ssa/di.go @@ -141,8 +141,7 @@ func (b diBuilder) createType(ty Type, pos token.Position) DIType { }) return &aDIType{typ} } else { - encoding = llvm.DW_ATE_unsigned - panic("todo: basic type") + panic(fmt.Errorf("can't create debug info of basic type: %v, %T", ty.RawType(), ty.RawType())) } typ = b.di.CreateBasicType(llvm.DIBasicType{