summaryrefslogtreecommitdiffstats
path: root/llgo
Commit message (Collapse)AuthorAgeFilesLines
* irgen: don't emit debug metadata for localsAndrew Wilkins2015-01-292-12/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: The debug metadata we generate is wrong, and is now causing build failures. This revision disables the only llvm.dbg.declare calls we make. (There is also a drive-by fix to CMakeLists.txt, adding in a missing .go dependency.) Fixes http://llvm.org/bugs/show_bug.cgi?id=22330 Reviewers: pcc Reviewed By: pcc Subscribers: dblaikie, llvm-commits Differential Revision: http://reviews.llvm.org/D7222 llvm-svn: 227403
* Introduce llgoi, a REPL for GoPeter Collingbourne2015-01-1515-7/+701
| | | | | | | | | | llgoi is a Go REPL based on llgo irgen and the LLVM JIT. It supports expressions, statements, most declarations and imports, including binary imports from the standard library and source imports from $GOPATH. Differential Revision: http://reviews.llvm.org/D6957 llvm-svn: 226097
* irgen: expose DisableUnusedImportCheck flagPeter Collingbourne2015-01-141-0/+5
| | | | | | Differential Revision: http://reviews.llvm.org/D6956 llvm-svn: 225946
* irgen: expose PackageCreated hookPeter Collingbourne2015-01-141-1/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D6955 llvm-svn: 225945
* Roll gotools to 47f2109c.Peter Collingbourne2015-01-13694-72866/+1458
| | | | | | | | | | | At the same time, perform a number of simplifications: - Rename go.tools directory to gotools. - Import only the go directory; all required Go analysis code and its dependencies have now been moved to this directory. llvm-svn: 225825
* [llgo] irgen: generate switch instructionsAndrew Wilkins2015-01-083-1/+216
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: With this patch, llgo uses ssautil.Switches to reconstitute (and synthesise) switches, which can then be lowered to lookup tables, trees, etc. We currently only handle integer const case switches. We erase the comparison blocks (other than the initial block), and generate a switch instruction at the end of the block starting the if-else-if chain. ssautil.Switches does not remove duplicate const cases (e.g. same operands for "||"), so we do this in llgo for now. Test Plan: lit test added Reviewers: pcc Reviewed By: pcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6831 llvm-svn: 225433
* Test commit to check the new git mirror.Chandler Carruth2015-01-071-0/+1
| | | | llvm-svn: 225394
* [llgo] Elide alloca for unused received values in selectAndrew Wilkins2014-12-313-29/+50
| | | | | | | | | | | | | | | | Summary: If a receive case in a select statement is not assigned to a named variable, then we can eliminate the alloca and copy at runtime. Test Plan: lit test added Reviewers: pcc Reviewed By: pcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6785 llvm-svn: 225033
* irgen: modify the ABI to use init guards instead of priorityPeter Collingbourne2014-12-314-11/+92
| | | | | | | | | | | | | | | | | | | | | | | | The new ABI is simpler for use cases such as dynamically loaded packages. The calling convention for import functions is similar to what go/ssa would produce if BareInits were cleared. However, simply clearing this flag causes two additional issues: 1) We would need to special case the 'init$guard' variable (see discussion in https://codereview.appspot.com/78780043/). 2) The call to __go_register_gc_roots needs to appear in the right place, i.e. after the guard check. Making this check appear in the right place with non-bare inits seems unreliable at best. So we keep BareInits set and generate the necessary code manually. It is still possible to get the old ABI by specifying a path to a gccgo installation. Differential Revision: http://reviews.llvm.org/D6804 llvm-svn: 225030
* irgen: make it possible to use a custom importerPeter Collingbourne2014-12-311-22/+41
| | | | | | Differential Revision: http://reviews.llvm.org/D6803 llvm-svn: 225029
* irgen: return a types.Package to the compiler clientPeter Collingbourne2014-12-311-1/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D6802 llvm-svn: 225028
* irgen: introduce ManglePackagePath functionPeter Collingbourne2014-12-311-7/+7
| | | | | | | | | This is useful for clients that need to use llgo's mangling of the package path to look up a specific function within a given package. Differential Revision: http://reviews.llvm.org/D6801 llvm-svn: 225027
* irgen, driver: modify Compiler.Compile to take a FileSet and FilesPeter Collingbourne2014-12-314-14/+18
| | | | | | | | | | | This change allows clients to generate IR using "files" received from locations other than the file system. The regular file parser is moved to a new library, "driver", which is intended to eventually contain much of the logic from the existing driver. Differential Revision: http://reviews.llvm.org/D6794 llvm-svn: 225026
* [cmake/multilib] Teach llgo to respect the LLVM_LIBDIR_SUFFIX variable forChandler Carruth2014-12-293-23/+50
| | | | | | | | | | | | | | | | | multilib build and installs. Summary: This requires introducing a generated header to encapsulate the LLVM_LIBDIR_SUFFIX value from the build system and push it into the go code. From there, I've adjusted the gllgo code to systematically use this rather than a raw "lib". This requires some awkwardness as one of the flags *must* be "lib"-relative for compatibility with how gccgo works. For that flag, we use ".." to back up a directory and then go into the proper lib directory. Differential Revision: http://reviews.llvm.org/D6795 llvm-svn: 224964
* irgen: remove unused compiler.runtimetypespkg field.Peter Collingbourne2014-12-291-4/+0
| | | | llvm-svn: 224931
* irgen: do not emit an extra terminator for panic thunksPeter Collingbourne2014-12-283-4/+16
| | | | | | | | Found with GoSmith. Differential Revision: http://reviews.llvm.org/D6714 llvm-svn: 224904
* Test commitAndrew Wilkins2014-12-191-0/+1
| | | | | | Just changing whitespace to test commit access... llvm-svn: 224565
* irgen: fix canAvoid*Peter Collingbourne2014-12-172-10/+35
| | | | | | | | | | | | | | | | Patch by Andrew Wilkins! canAvoidElementLoad and canAvoidLoad were incorrectly eliding loads when an index expression is used as an another array index expression. This led to a panic. See comments on https://github.com/go-llvm/llgo/issues/175 Test Plan: lit test added Differential Revision: http://reviews.llvm.org/D6676 llvm-svn: 224420
* Use the object's package to mangle method names, rather than the receiver's ↵Peter Collingbourne2014-12-164-8/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | package If we use the receiver's package, we can end up with identical manglings for different functions. Consider: package p type U struct{} func (U) f() package q import "p" type T struct { p.U } func (T) f() The method set of *T has two synthetic methods named (*T).f(); one forwards to (T).f(), and the other to (U).f(). Previously, we were distinguishing them by the receiver's package, and in this case because both methods have the same receiver, they received the same name. The methods are correctly distinguished by the package owning the identifier "f", which is available via f.Object().Pkg(). Differential Revision: http://reviews.llvm.org/D6673 llvm-svn: 224357
* Update to new bindings.Peter Collingbourne2014-12-132-55/+49
| | | | llvm-svn: 224180
* Optimize comparisons to empty string.Peter Collingbourne2014-12-091-0/+16
| | | | | | | | Geo-mean performance improvement of 0.2% (-0.3% - 0.9% @ 95% CI). Differential Revision: http://reviews.llvm.org/D6569 llvm-svn: 223728
* Add .arcconfig file.Peter Collingbourne2014-12-081-0/+4
| | | | llvm-svn: 223689
* Roll gofrontend to 2a85649c19e1.Peter Collingbourne2014-12-049-37/+61
| | | | llvm-svn: 223385
* Initial commit of llgo third_party.Peter Collingbourne2014-11-272568-0/+675343
| | | | llvm-svn: 222858
* Initial commit of llgo.Peter Collingbourne2014-11-27148-0/+15789
llvm-svn: 222857
OpenPOWER on IntegriCloud