i've read some papers said that he changed the go source file to llvm ir 
using llgo.
but i found that llgo is not maintained .

So i search and find gollvm <https://go.googlesource.com/gollvm#seetheir> in 
https://go.googlesource.com/gollvm#seetheir.

i follow its instruction steps and build the gollvm and llvm-goc 
successfully.

But something confuse me that is i can not import external package while 
using llvm-goc to dump llvm ir.

For example, i've tried dump the code below to llvm-ir,

===
*package main*

*import (*
*    "fmt"*
*    "test/testg"*
*)*

*func add(x, y int) int {*
*    return x + y*
*}*


*func main() {*
*    var c = testg.Color{}*
*    a := 5000*
*    //b := 4*
*    fmt.Println(add(a, c.C))*
*}*
===
But llvm-goc returns errors:

===
*./main.go:5:15: error: import file 'test/testg' not found*
*./main.go:14:24: error: expected ';' or '}' or newline*
*./main.go:15:5: error: expected declaration*
*./main.go:17:5: error: expected declaration*
*./main.go:18:1: error: expected declaration*
*./main.go:14:13: error: reference to undefined name 'testg'*
===

I wonder whether the llvm-goc can use external packages? Or is there anyway 
to dump llvm-ir from go source file ?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/5ae30fb1-1461-4b40-bfb9-6845a40dd31an%40googlegroups.com.

Reply via email to