summaryrefslogtreecommitdiffstats
path: root/gcc/go/gofrontend/parse.cc
Commit message (Collapse)AuthorAgeFilesLines
* PR go/61308ian2014-08-051-1/+4
| | | | | | | | | | | | | compiler: Handle enclosing vars for function type in function lit. This fixes a dumb bug in which the enclosing vars were incorrectly cleared when a function literal contains a reference to a function type. The test for this will go into the master repository in the change at http://codereview.appspot.com/121200043 . git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@213617 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Better error messages for { on line after if/for/switch.ian2013-12-121-3/+22
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205944 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Implement 3-index slicing.ian2013-10-241-2/+19
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204034 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Error if receiver and parameter have same name.ian2013-10-111-0/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203455 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Error for qualified ID as field name in struct literal.ian2013-10-081-2/+9
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203292 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Avoid knockon errors for invalid uses of _.ian2013-09-281-5/+5
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203006 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: don't permit nil assignment to blank identifier.ian2013-09-251-4/+1
| | | | | | | Fixes https://code.google.com/p/go/issues/detail?id=6005. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202881 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Don't generate value reference in range clause if receiver is a sink.ian2013-08-171-1/+2
| | | | | | | | | The panic in test/fixedbugs/bug454.go was caused by the generation of an unnecessary var reference when writing a range value into a sink. If the receiving variable is a sink, there's no need to dereference a possible NULL pointer. Fixes Issue 24. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201815 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: more consistent error message for [...]T(x)ian2013-06-271-1/+1
| | | | | | | | The message should be similar to the one for "var x [...]T", not to the message for []T(x...). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200490 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: disallow fallthrough in last case of switch.ian2013-06-261-0/+3
| | | | | | | | In spec: A "fallthrough" statement may appear as the last statement of all but the last clause of an expression switch. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200440 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: generate dummy names for blank-named constants.ian2013-06-241-0/+10
| | | | | | | Otherwise such const declarations are not checked. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200381 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler, runtime: Use function descriptors.ian2013-06-181-5/+19
| | | | | | | | | | | | | | | | This changes the representation of a Go value of function type from being a pointer to function code (like a C function pointer) to being a pointer to a struct. The first field of the struct points to the function code. The remaining fields, if any, are the addresses of variables referenced in enclosing functions. For each call to a function, the address of the function descriptor is passed as the last argument. This lets us avoid generating trampolines, and removes the use of writable/executable sections of the heap. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200181 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Accept trailing comma after varargs parameter.ian2012-12-131-2/+2
| | | | | | | | Also fix handling of interfaces seen only in a function or method declaration. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194492 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Correct test for whether go/defer arg is parenthesized.ian2012-12-061-42/+82
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194240 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Accept trailing comma after expression in type conversion.ian2012-12-051-0/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194176 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Don't permit go/defer argument to be parenthesized.ian2012-12-041-3/+6
| | | | | | | Fixes Go repository issue 4468. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194112 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Implement //go:nointerface comments.ian2012-11-281-3/+27
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193874 138bc75d-0d04-0410-961f-82ee72b054a4
* PR translation/53764ian2012-11-191-1/+1
| | | | | | | | | compiler: Fix typo in error message. Reported by Roland Stigge. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193626 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Fix a, b, c := b, a, 1 when a and b already exist.ian2012-10-031-15/+56
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192022 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Fix parse of (<- chan <- chan <- int)(x).ian2012-10-021-8/+81
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192011 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Better error for missing comma in composite literal.ian2012-09-271-1/+5
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191795 138bc75d-0d04-0410-961f-82ee72b054a4
* compile: Detect invalid and likely-bad import statements.ian2012-09-171-1/+2
| | | | | | | * Make-lang.in (go/gogo.o): Depend on filenames.h. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191372 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Add -fgo-pkgpath option.ian2012-05-091-6/+6
| | | | | | | | | | | | | | | | | | | * lang.opt: Add -fgo-pkgpath. * go-lang.c (go_pkgpath): New static variable. (go_prefix): New static variable. (go_langhook_init): Pass go_pkgpath and go_prefix to go_create_gogo. (go_langhook_handle_option): Handle -fgo-pkgpath. Change -fgo-prefix handling to just set go_prefix. * go-c.h (go_set_prefix): Don't declare. (go_create_gogo): Add pkgpath and prefix to declaration. * go-gcc.cc (Gcc_backend::global_variable): Change unique_prefix to pkgpath. Don't include the package name in the asm name. * gccgo.texi (Invoking gccgo): Document -fgo-pkgpath. Update the docs for -fgo-prefix. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187356 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Correct parse of for with possible composite literal.ian2012-05-041-21/+42
| | | | | | | Fixes, e.g., "for first := true; first; first = false {". git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187176 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Fix order of initialization bug with global var a, b = f().ian2012-05-031-1/+17
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187103 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Reject invalid composite literals.ian2012-04-241-1/+10
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186766 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: fix crashes.ian2012-03-281-1/+1
| | | | | | | | | | | | | The compiler would crash on: if true || x, y := 1, 2 {} and var s string s = append(s, "hello") Reported in issue 3186. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185928 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Avoid some compiler crashes on invalid code.ian2012-03-011-2/+3
| | | | | | | | | * go-gcc.cc (class Gcc_tree): Add set_tree method. (set_placeholder_pointer_type): When setting to a pointer to error, set to error_mark_node. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184684 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Permit (_) on left hand side of =.ian2012-02-171-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184356 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler, libgo: Use //extern comments rather than __asm__.ian2012-02-071-5/+17
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183981 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Don't crash on switch _ := v.(type).ian2012-02-011-3/+10
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183814 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Permit a general expression in case x := <-c.ian2012-02-011-9/+17
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183802 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Simple statement in type switch is in different block.ian2012-01-241-2/+24
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183496 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Verify types of sink variables.ian2012-01-241-0/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183482 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Better handling of erroneous function signatures.ian2012-01-241-9/+55
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183479 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Give an error if a variable is defined but not used.ian2012-01-231-2/+50
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183458 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Change alias handling, change rune alias to int32.ian2012-01-211-0/+9
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183374 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Handle _ with explicit type correctly.ian2012-01-201-2/+15
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183358 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler/runtime: Copy channel implementation from master library.ian2011-12-011-2/+0
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181874 138bc75d-0d04-0410-961f-82ee72b054a4
* compiler: Define and use backend-independent Location class.ian2011-11-291-90/+92
| | | | | | | | | | | | | | | | From Sanjoy Das. * go-location.h: New file. * go-linemap.cc: New file. * go-gcc.cc: Change all uses of source_location to Location. * Make-lang.in (GO_OBJS): Add go/go-linemap.o. (GO_LINEMAP_H): New variable. (GO_LEX_H): Use $(GO_LINEMAP_H). (GO_GOGO_H, GO_TYPES_H, GO_IMPORT_H): Likewise. (go/go-linemap.o): New target. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181813 138bc75d-0d04-0410-961f-82ee72b054a4
* Error if naked return when result variables are shadowed.ian2011-10-241-0/+17
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180401 138bc75d-0d04-0410-961f-82ee72b054a4
* Better parsing of erroneous expression on left of :=.ian2011-09-231-1/+26
| | | | | | | Better parsing of erroneous non-type in type switch. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179133 138bc75d-0d04-0410-961f-82ee72b054a4
* Better handling of unexpected EOF in parser.ian2011-09-211-0/+7
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179060 138bc75d-0d04-0410-961f-82ee72b054a4
* Fix typo in error message.ian2011-09-211-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179025 138bc75d-0d04-0410-961f-82ee72b054a4
* Improve error for undefined name in imported package.ian2011-09-201-3/+10
| | | | | | | Avoid emitting some followon errors. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179020 138bc75d-0d04-0410-961f-82ee72b054a4
* Implement goto restrictions.ian2011-09-201-7/+16
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179018 138bc75d-0d04-0410-961f-82ee72b054a4
* Check for duplicate parameter/result names.ian2011-09-201-3/+35
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179010 138bc75d-0d04-0410-961f-82ee72b054a4
* Emit compiler errors for unused values.ian2011-09-201-3/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179008 138bc75d-0d04-0410-961f-82ee72b054a4
* Improve errors for invalid use of [...]type.ian2011-09-171-2/+15
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178921 138bc75d-0d04-0410-961f-82ee72b054a4
* Fix using package name as composite literal struct key.ian2011-09-101-2/+36
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178747 138bc75d-0d04-0410-961f-82ee72b054a4
OpenPOWER on IntegriCloud