Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

LLVM-based compiler for Go

branch: master

This branch is 0 commits ahead and 0 commits behind master

Octocat-spinner-32 build Export package data December 30, 2013
Octocat-spinner-32 cmd cmd/llgo-build: record and use CGO_LDFLAGS March 09, 2014
Octocat-spinner-32 debug Start implementing cgo support February 25, 2014
Octocat-spinner-32 importer Use go.tools/go/importer March 02, 2014
Octocat-spinner-32 llgo Remove remaining C++ exception code February 28, 2014
Octocat-spinner-32 pkg Remove remaining C++ exception code February 28, 2014
Octocat-spinner-32 .gitignore .gitignore: add llgo-dist and llgo-build September 16, 2013
Octocat-spinner-32 LICENSE Use "The llgo Authors" in copyright March 02, 2013
Octocat-spinner-32 README.md Update README January 07, 2014
Octocat-spinner-32 alg.go Don't branch in struct comparisons December 22, 2013
Octocat-spinner-32 annotations.go Update to provisional go/loader API January 19, 2014
Octocat-spinner-32 attribute.go Reenable source annotations October 20, 2013
Octocat-spinner-32 builtins.go Fix slices November 12, 2013
Octocat-spinner-32 call.go Non-branching function calls December 27, 2013
Octocat-spinner-32 channels.go Update to latest go.tools December 22, 2013
Octocat-spinner-32 closures.go Various fixes December 28, 2013
Octocat-spinner-32 coerce.go Always generate ifn wrappers for non-pointer receivers January 03, 2014
Octocat-spinner-32 compiler.go Suppress clang/llgo data layout link warnings February 28, 2014
Octocat-spinner-32 convert.go Always generate ifn wrappers for non-pointer receivers January 03, 2014
Octocat-spinner-32 debug.go Partial DWARF support February 14, 2014
Octocat-spinner-32 indirect.go Various fixes December 28, 2013
Octocat-spinner-32 interfaces.go Revert method receiver->signature change in MethodSet args February 14, 2014
Octocat-spinner-32 maps.go Remove branching from map iteration December 22, 2013
Octocat-spinner-32 parser.go Various cleanups October 16, 2013
Octocat-spinner-32 predicates.go Implement append, work towards interfaces, panic/defer/recover October 18, 2013
Octocat-spinner-32 println.go Implement Range (maps only) and delete November 11, 2013
Octocat-spinner-32 runtime.go Define fields in runtime struct types December 29, 2013
Octocat-spinner-32 slice.go Fix slicing of pointer to named array type December 14, 2013
Octocat-spinner-32 ssa.go Qualify anonymous functions with enclosing March 09, 2014
Octocat-spinner-32 strings.go Implement string indexing, string range November 15, 2013
Octocat-spinner-32 targets.go Suppress clang/llgo data layout link warnings February 28, 2014
Octocat-spinner-32 typemap.go Start implementing cgo support February 25, 2014
Octocat-spinner-32 types.go Name all runtime types; assign linkonce linkage January 05, 2014
Octocat-spinner-32 utils.go Update to provisional go/loader API January 19, 2014
Octocat-spinner-32 value.go Update to latest go/types API January 29, 2014
Octocat-spinner-32 version.go Use "The llgo Authors" in copyright March 02, 2013
README.md

Build Status

llgo

llgo is a Go frontend for LLVM, written in Go.

llgo is under active development, but is still considered experimental. It is not presently useful for real work. Progress will be reported at http://blog.awilkins.id.au.

Installation

To install llgo, use llgo-dist:

go get github.com/axw/llgo/cmd/llgo-dist
llgo-dist

You should have the latest version of LLVM in your $PATH (3.3 has been confirmed to be compatible). If LLVM is not in $PATH, llgo-dist also has a flag that can specified to point at the LLVM installation: -llvm-config=<path/to/llvm-config>.

llgo requires Go 1.2+.

Running

llgo-dist builds two binaries: there's llgo, the compiler; and there's llgo-build, which is a poor man's go build for llgo.

The compiler is comparable with 6g: it takes a set of Go source files as arguments, and produces an object file. The output is an LLVM bitcode module. There are several flags that alter the behaviour: -triple=<triple> specifies the target LLVM triple to compile for; -dump causes llgo to dump the module in its textual IR form instead of generating bitcode.

The llgo-build tool accepts either Go filenames, or package names, just like go build. If the package is a command, then llgo-build will compile it, link in its dependencies, and translate the LLVM bitcode to a native binary. If you want an untranslated module, specify the -emit-llvm flag.

llgo-build has some additional flags for testing: -run causes llgo-build to execute and dispose of the resultant binary. Passing -test causes llgo-build to generate a test program for the specified package, just like go test -c.

Testing

First install llgo using llgo-dist, as described above. Then you can run the functional tests like so:

go test -v github.com/axw/llgo/llgo

You can also run the compiler tests from gc's source tree ($GOROOT/test) by specifying the build tag go_test:

go test -v -tags go_test github.com/axw/llgo/llgo -run StandardTests
Something went wrong with that request. Please try again.