-
-
Notifications
You must be signed in to change notification settings - Fork 5
Use C++ implement llvm compiler #5
Comments
Ok |
Hi @dannypsnl! I just came across your project the other day and have started to learn more about it. I'd be curious to know what parts were missing in llir/llvm that made it not possible to use. We are preparing for the v0.3.0 release of llir/llvm so it would be great to get some feedback! Cheerful regards, |
Hi @mewmew, think for your work, |
Ah, @alecthomas's
That's good feedback. In v0.3.0, Now to create functions, use ir.NewFunc, this returns a function that you can add to a module using regular Go m := ir.NewModule()
f := ir.NewFunc("foo", types.I32)
m.Funcs = append(m.Funcs, f) There is also a shorthand to do the exact same thing in one step instead of two: m := ir.NewModule()
f := m.NewFunc("foo", types.I32) Using the From https://github.com/llir/llvm/blob/master/ir/module_function.go#L9: func (m *Module) NewFunc(name string, retType types.Type, params ...*Param) *Function {
f := NewFunc(name, retType, params...)
m.Funcs = append(m.Funcs, f)
return f
} Cheers, |
Unfortunately, llir/llvm can not do something I want, and go-llvm binding has poor document.
I think should use C++ to write the translate part, but we can use Go write the remain part.
The text was updated successfully, but these errors were encountered: