]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/cgo, go/build: finish a cleanup TODO
authorMatthew Dempsky <mdempsky@google.com>
Thu, 8 Jan 2015 00:30:24 +0000 (16:30 -0800)
committerIan Lance Taylor <iant@golang.org>
Thu, 8 Jan 2015 00:59:37 +0000 (00:59 +0000)
Removing #cgo directive parsing from cmd/cgo was done in
https://golang.org/cl/8610044.

Change-Id: Id1bec58c6ec1f932df0ce0ee84ff253655bb73ff
Reviewed-on: https://go-review.googlesource.com/2501
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/cgo/gcc.go
src/go/build/build.go

index 2316ff0e20336b3c293569d209d4b12aeb57d35c..864fda02582e61529d400af6640c34fd907d9f5f 100644 (file)
@@ -154,20 +154,6 @@ func splitQuoted(s string) (r []string, err error) {
        return args, err
 }
 
-var safeBytes = []byte(`+-.,/0123456789:=ABCDEFGHIJKLMNOPQRSTUVWXYZ\_abcdefghijklmnopqrstuvwxyz`)
-
-func safeName(s string) bool {
-       if s == "" {
-               return false
-       }
-       for i := 0; i < len(s); i++ {
-               if c := s[i]; c < 0x80 && bytes.IndexByte(safeBytes, c) < 0 {
-                       return false
-               }
-       }
-       return true
-}
-
 // Translate rewrites f.AST, the original Go input, to remove
 // references to the imported package C, replacing them with
 // references to the equivalent Go types, functions, and variables.
index 62935ee0cfabbbd97dd9d69395114e906d98b408..6e95e486fed28d891c75743eecd48b4d80839977 100644 (file)
@@ -1073,9 +1073,6 @@ func (ctxt *Context) shouldBuild(content []byte, allTags map[string]bool) bool {
 // saveCgo saves the information from the #cgo lines in the import "C" comment.
 // These lines set CFLAGS, CPPFLAGS, CXXFLAGS and LDFLAGS and pkg-config directives
 // that affect the way cgo's C code is built.
-//
-// TODO(rsc): This duplicates code in cgo.
-// Once the dust settles, remove this code from cgo.
 func (ctxt *Context) saveCgo(filename string, di *Package, cg *ast.CommentGroup) error {
        text := cg.Text()
        for _, line := range strings.Split(text, "\n") {