diff options
author | Matthew Dempsky <mdempsky@google.com> | 2017-01-11 15:48:30 -0800 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2017-01-13 23:07:14 +0000 |
commit | ec63158d7104ab6eb3765f7d4ea48744f97d9ff9 (patch) | |
tree | 4148adfb7821e413a15518b2d3a7a35e3c821d7a /src/cmd/compile/internal/gc/lex.go | |
parent | b90aed020dc9bd430c9a451386550d26c2355ea5 (diff) | |
download | go-git-dev.inline.tar.gz |
[dev.inline] cmd/compile: parse source files concurrentlydev.inline
Conversion to Nodes still happens sequentially at the moment.
Change-Id: I3407ba0711b8b92e22ece0a06fefaff863c3ccc9
Reviewed-on: https://go-review.googlesource.com/35126
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/gc/lex.go')
-rw-r--r-- | src/cmd/compile/internal/gc/lex.go | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/src/cmd/compile/internal/gc/lex.go b/src/cmd/compile/internal/gc/lex.go index 5ff55d7c83..c0039fd880 100644 --- a/src/cmd/compile/internal/gc/lex.go +++ b/src/cmd/compile/internal/gc/lex.go @@ -40,17 +40,15 @@ func plan9quote(s string) string { return s } -type Pragma syntax.Pragma - const ( // Func pragmas. - Nointerface Pragma = 1 << iota - Noescape // func parameters don't escape - Norace // func must not have race detector annotations - Nosplit // func should not execute on separate stack - Noinline // func should not be inlined - CgoUnsafeArgs // treat a pointer to one arg as a pointer to them all - UintptrEscapes // pointers converted to uintptr escape + Nointerface syntax.Pragma = 1 << iota + Noescape // func parameters don't escape + Norace // func must not have race detector annotations + Nosplit // func should not execute on separate stack + Noinline // func should not be inlined + CgoUnsafeArgs // treat a pointer to one arg as a pointer to them all + UintptrEscapes // pointers converted to uintptr escape // Runtime-only func pragmas. // See ../../../../runtime/README.md for detailed descriptions. @@ -63,7 +61,7 @@ const ( NotInHeap // values of this type must not be heap allocated ) -func pragmaValue(verb string) Pragma { +func pragmaValue(verb string) syntax.Pragma { switch verb { case "go:nointerface": if obj.Fieldtrack_enabled != 0 { @@ -78,24 +76,12 @@ func pragmaValue(verb string) Pragma { case "go:noinline": return Noinline case "go:systemstack": - if !compiling_runtime { - yyerror("//go:systemstack only allowed in runtime") - } return Systemstack case "go:nowritebarrier": - if !compiling_runtime { - yyerror("//go:nowritebarrier only allowed in runtime") - } return Nowritebarrier case "go:nowritebarrierrec": - if !compiling_runtime { - yyerror("//go:nowritebarrierrec only allowed in runtime") - } return Nowritebarrierrec | Nowritebarrier // implies Nowritebarrier case "go:yeswritebarrierrec": - if !compiling_runtime { - yyerror("//go:yeswritebarrierrec only allowed in runtime") - } return Yeswritebarrierrec case "go:cgo_unsafe_args": return CgoUnsafeArgs |