cl: _testdata/printf

This commit is contained in:
xushiwei
2024-04-21 17:54:51 +08:00
parent 7cab76f444
commit 7ffedc2da7
5 changed files with 77 additions and 19 deletions

View File

@@ -258,7 +258,7 @@ func (b Builder) UnOp(op token.Token, x Expr) Expr {
// Load returns the value at the pointer ptr.
func (b Builder) Load(ptr Expr) Expr {
if debugInstr {
log.Printf("Load @%v\n", ptr.impl.Name())
log.Printf("Load %v\n", ptr.impl.Name())
}
telem := b.prog.Elem(ptr.Type)
return Expr{llvm.CreateLoad(b.impl, telem.ll, ptr.impl), telem}
@@ -267,7 +267,7 @@ func (b Builder) Load(ptr Expr) Expr {
// Store stores val at the pointer ptr.
func (b Builder) Store(ptr, val Expr) Builder {
if debugInstr {
log.Printf("Store @%v, %v\n", ptr.impl.Name(), val.impl)
log.Printf("Store %v, %v\n", ptr.impl.Name(), val.impl)
}
b.impl.CreateStore(val.impl, ptr.impl)
return b