]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: cleanup pragcgo
authorMartin Möhrmann <martisch@uos.de>
Thu, 7 Apr 2016 06:01:47 +0000 (08:01 +0200)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 12 Apr 2016 05:37:00 +0000 (05:37 +0000)
commit07669d2737aa51107a4e54b61d6704f6ad8035b5
tree5486b97b808559a4e123919be47bd905d8f669a0
parente569b10ebaed8fbf27d0b55886b6a81d635ddbc7
cmd/compile: cleanup pragcgo

Removes dynimport, dynexport, dynlinker cases since they can not
be reached due to prefix check for "go:cgo_" in getlinepragma.

Replaces the if chains for verb distinction by a switch statement.
Replaces fmt.Sprintf by fmt.Sprintln for string concatenation.

Removes the more, getimpsym and getquoted functions by introducing a
pragmaFields function that partitions a pragma into its components.

Adds tests for cgo pragmas.

Change-Id: I43c7b9550feb3ddccaff7fb02198a3f994444123
Reviewed-on: https://go-review.googlesource.com/21607
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/gc/lex.go
src/cmd/compile/internal/gc/lex_test.go [new file with mode: 0644]