llvm-project/llgo
Andrew Wilkins 5fdb3b89da [llgo] add llgo source path to LLVM_GO_PACKAGES
Summary:
To support the use of LLVM_EXTERNAL_LLGO_SOURCE_DIR,
with llgo situated in a location other than tools/llgo,
we add the llgo source directory to LLVM_GO_PACKAGES.

Reviewers: pcc

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D21635

llvm-svn: 276828
2016-07-27 03:01:00 +00:00
..
autoconf [llgo] Roll gofrontend forward 2016-03-15 05:36:43 +00:00
build
cmd [llgo] llgoi: separate evaluation from printing 2016-04-25 01:18:20 +00:00
debug [llgo] Increment "Debug Info Version" 2016-03-23 23:09:00 +00:00
docs Add documentation for llgoi, update README 2015-04-05 23:32:13 +00:00
driver irgen, driver: modify Compiler.Compile to take a FileSet and Files 2014-12-31 00:25:32 +00:00
include
irgen [llgo] Roll gofrontend forward 2016-03-15 05:36:43 +00:00
ssaopt Roll gotools to 47f2109c. 2015-01-13 20:45:08 +00:00
test [llgo] llgoi: separate evaluation from printing 2016-04-25 01:18:20 +00:00
third_party [llgo] Roll gofrontend forward 2016-03-15 05:36:43 +00:00
utils/benchcomp benchcomp: Add a mode for analyzing rule execution time in ninja log files. 2016-04-08 22:42:22 +00:00
.arcconfig Upgrade all the .arcconfigs to https. 2016-07-14 13:15:37 +00:00
CMakeLists.txt [llgo] add llgo source path to LLVM_GO_PACKAGES 2016-07-27 03:01:00 +00:00
LICENSE.TXT [llgo] cmd/llgoi: use line editor 2015-05-23 15:16:09 +00:00
README.TXT Update to new lists.llvm.org 2015-08-05 04:03:05 +00:00
buildslave-config.yaml [llgo] add buildbot-slave config 2015-04-08 01:41:46 +00:00
libgo-check-failures.diff [llgo] Roll gofrontend forward 2016-03-15 05:36:43 +00:00
libgo-noext.diff Roll gofrontend to 07baa07598ea; roll libffi to r219477. 2015-04-05 23:31:49 +00:00
llgo-go.sh
update_third_party.sh [llgo] Roll gofrontend forward 2016-03-15 05:36:43 +00:00

README.TXT

llgo
====

llgo is a Go (http://golang.org) frontend for LLVM, written in Go.

llgo is under active development. It compiles and passes most of the
standard library test suite and a substantial portion of the gc test suite,
but there are some corner cases that are known not to be handled correctly
yet. Nevertheless it can compile modestly substantial programs (including
itself; it is self hosting on x86-64 Linux).

Mailing list: https://groups.google.com/d/forum/llgo-dev

Supported platforms
-------------------

llgo is currently only supported on the x86-64 Linux platform. Contributions
that add support for other platforms are welcome.

There are two components which would need to be ported to new platforms: the
compiler and the runtime library. The compiler has little platform-specific
code; the most significant is in irgen/cabi.go. The main limiting factor
for new platforms is the runtime library in third_party/gofrontend/libgo,
which inherits some support for other platforms from the gc compiler's
runtime library, but this support tends to be incomplete.

Installation
------------

llgo requires:
* Go 1.3 or later.
* CMake 2.8.8 or later (to build LLVM).
* A modern C++ toolchain (to build LLVM).
  http://llvm.org/docs/GettingStarted.html#getting-a-modern-host-c-toolchain

Note that Ubuntu Precise is one Linux distribution which does not package
a sufficiently new CMake or C++ toolchain.

To build and install llgo:

    # Checkout LLVM:
    svn co http://llvm.org/svn/llvm-project/llvm/trunk /path/to/llvm

    # Checkout Clang:
    cd /path/to/llvm/tools
    svn co http://llvm.org/svn/llvm-project/cfe/trunk clang

    # Checkout llgo:
    svn co http://llvm.org/svn/llvm-project/llgo/trunk llgo

    # Build LLVM, Clang and llgo: (see also http://llvm.org/docs/CMake.html)
    mkdir /path/to/llvm-build
    cd /path/to/llvm-build
    cmake /path/to/llvm -DCMAKE_INSTALL_PREFIX=/path/to/llvm-inst
    make install

Running
-------

llgo-go is llgo's version of the "go" command. It has the same command line
interface as go, and works the same way, but it uses llgo to compile.

llgoi is an interactive REPL for Go. It supports expressions, statements, most
declarations and imports, including binary imports from the standard library
and source imports from $GOPATH. See docs/llgoi.rst for more information.

llgo is the compiler binary. It has a command line interface that is intended
to be compatible to a large extent with gccgo.

Contributing
------------

Changes to code outside the third_party directory should be contributed in
the normal way by sending patches to <llvm-commits@lists.llvm.org>.

Changes to code in the third_party directory must first be made in the
respective upstream project, from which they will be mirrored into the llgo
repository. See the script update_third_party.sh for the locations of the
upstream projects and details of how the mirroring works.