Commit ee94cd1d authored by Matthew Dempsky's avatar Matthew Dempsky Committed by Ian Lance Taylor

cmd/cgo, go/build: finish a cleanup TODO

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/2501Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 58329334
...@@ -154,20 +154,6 @@ func splitQuoted(s string) (r []string, err error) { ...@@ -154,20 +154,6 @@ func splitQuoted(s string) (r []string, err error) {
return args, err 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 // Translate rewrites f.AST, the original Go input, to remove
// references to the imported package C, replacing them with // references to the imported package C, replacing them with
// references to the equivalent Go types, functions, and variables. // references to the equivalent Go types, functions, and variables.
......
...@@ -1073,9 +1073,6 @@ func (ctxt *Context) shouldBuild(content []byte, allTags map[string]bool) bool { ...@@ -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. // 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 // These lines set CFLAGS, CPPFLAGS, CXXFLAGS and LDFLAGS and pkg-config directives
// that affect the way cgo's C code is built. // 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 { func (ctxt *Context) saveCgo(filename string, di *Package, cg *ast.CommentGroup) error {
text := cg.Text() text := cg.Text()
for _, line := range strings.Split(text, "\n") { for _, line := range strings.Split(text, "\n") {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment