ssa: support string and pointer debug info, fix params debugging

This commit is contained in:
Li Jie
2024-09-18 16:42:47 +08:00
parent 4dbfc9483e
commit d85a080f9b
8 changed files with 342 additions and 283 deletions

View File

@@ -144,6 +144,16 @@ func (b Builder) Alloca(n Expr) (ret Expr) {
return
}
func (b Builder) AllocaT(t Type) (ret Expr) {
if debugInstr {
log.Printf("AllocaT %v\n", t.RawType())
}
prog := b.Prog
ret.impl = llvm.CreateAlloca(b.impl, t.ll)
ret.Type = prog.Pointer(t)
return
}
/* TODO(xsw):
// AllocaU allocates uninitialized space for n*sizeof(elem) bytes.
func (b Builder) AllocaU(elem Type, n ...int64) (ret Expr) {