llvm cookbook 1.11 golang前端
2018-11-09 本文已影响11人
peteyuan
本文介绍llgo的使用。
安装llgo,需要翻墙
# Ensure $GOPATH is set.
go get -d github.com/go-llvm/llgo/cmd/gllgo
$GOPATH/src/llvm.org/llvm/bindings/go/build.sh -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD=host
cd $GOPATH/src/github.com/go-llvm/llgo
make install prefix=/path/to/prefix j=N # where N is the number of cores on your machine.
编写代码 test.go
package main
import "fmt"
func main() {
fmt.Println("vim-go")
}
执行命令:
llgo -dump test.go
输出:
#