]> Cypherpunks repositories - gostls13.git/commitdiff
document the gc go compilers.
authorRob Pike <r@golang.org>
Wed, 4 Nov 2009 06:00:36 +0000 (22:00 -0800)
committerRob Pike <r@golang.org>
Wed, 4 Nov 2009 06:00:36 +0000 (22:00 -0800)
fix the usage message.

R=rsc
CC=go-dev
http://go/go-review/1016033

src/cmd/5g/doc.go [new file with mode: 0644]
src/cmd/5l/doc.go
src/cmd/6g/doc.go [new file with mode: 0644]
src/cmd/6l/doc.go
src/cmd/8g/doc.go [new file with mode: 0644]
src/cmd/8l/doc.go
src/cmd/gc/doc.go [new file with mode: 0644]
src/cmd/gc/lex.c

diff --git a/src/cmd/5g/doc.go b/src/cmd/5g/doc.go
new file mode 100644 (file)
index 0000000..e45e355
--- /dev/null
@@ -0,0 +1,15 @@
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+/*
+
+5g is the version of the gc compiler for the ARM,
+referred to by these tools as arm.
+
+It reads .go files and outputs .5 files. The flags are documented in ../gc/doc.go.
+
+There is no instruction optimizer, so the -N flag is a no-op.
+
+*/
+package documentation
index 17200d57cd13274f2ddb8fcf07c24fa67232d7f2..495f6fa29368a56b99062ef8c59ff2bc1255b7f0 100644 (file)
@@ -9,6 +9,8 @@
        http://plan9.bell-labs.com/magic/man2html/1/2l
 
 Its target architecture is the ARM, referred to by these tools as arm.
+It reads files in .5 format generated by 5g, 5c, and 5a and emits
+a binary called 5.out by default.
 
 Major changes include:
        - support for segmented stacks (this feature is implemented here, not in the compilers).
diff --git a/src/cmd/6g/doc.go b/src/cmd/6g/doc.go
new file mode 100644 (file)
index 0000000..e4964db
--- /dev/null
@@ -0,0 +1,13 @@
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+/*
+
+6g is the version of the gc compiler for the x86-64,
+referred to by these tools as amd64.
+
+It reads .go files and outputs .6 files. The flags are documented in ../gc/doc.go.
+
+*/
+package documentation
index 8d87f820ef5641c669d2a43fd7ef165e236bd5ce..51663a8c8f7af5c16e65e3498ee488280bfbbf56 100644 (file)
@@ -9,6 +9,8 @@
        http://plan9.bell-labs.com/magic/man2html/1/2l
 
 Its target architecture is the x86-64, referred to by these tools as amd64.
+It reads files in .6 format generated by 6g, 6c, and 6a and emits
+a binary called 6.out by default.
 
 Major changes include:
        - support for ELF and Mach-O binary files 
diff --git a/src/cmd/8g/doc.go b/src/cmd/8g/doc.go
new file mode 100644 (file)
index 0000000..5b522fd
--- /dev/null
@@ -0,0 +1,15 @@
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+/*
+
+8g is the version of the gc compiler for the x86,
+referred to by these tools for historical reasons as 386.
+
+It reads .go files and outputs .8 files. The flags are documented in ../gc/doc.go.
+
+There is no instruction optimizer, so the -N flag is a no-op.
+
+*/
+package documentation
index 36628045c5b4ad161cfd6a4a0056bb5f6630eea1..e96015942276999cd5b49d2a194412d8b4307dfe 100644 (file)
@@ -9,6 +9,8 @@
        http://plan9.bell-labs.com/magic/man2html/1/2l
 
 Its target architecture is the x86, referred to by these tools for historical reasons as 386.
+It reads files in .8 format generated by 8g, 8c, and 8a and emits
+a binary called 8.out by default.
 
 Major changes include:
        - support for ELF and Mach-O binary files 
diff --git a/src/cmd/gc/doc.go b/src/cmd/gc/doc.go
new file mode 100644 (file)
index 0000000..f231132
--- /dev/null
@@ -0,0 +1,46 @@
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+/*
+
+The name gc is the generic label given to the family of Go compilers
+that function as part of the (modified) Plan 9 tool chain.  The C compiler
+documentation at
+
+       http://plan9.bell-labs.com/sys/doc/comp.pdf     (Tools overview)
+       http://plan9.bell-labs.com/sys/doc/compiler.pdf (C compiler architecture)
+
+gives the overall design of the tool chain.  Aside from a few adapted pieces,
+such as the optimizer, the Go compilers are wholly new programs.
+
+The compiler reads in a set of Go files, typically suffixed ".go".  They
+must all be part of one package.  The output is a single intermediate file
+representing the "binary assembly" of the compiled package, ready as input
+for the linker (6l, etc.).
+
+The generated files contain type information about the symbols exported by
+the package and about types used by symbols imported by the package from
+other packages. It is therefore not necessary when compiling client C of
+package P to read the files of P's dependencies, only the compiled output
+of P.
+
+Usage: 6g [flags] *.go  (or 8g or 5g)
+
+Flags:
+       -o file
+               output file, default 6.out for 6g, etc.
+       -e
+               normally the compiler quits after 10 errors; -e prints all errors
+       -I dir1 -I dir2
+               add dir1 and dir2 to the list of paths to check for imported packages
+       -N
+               disable optimization
+       -S
+               write assembly language text to standard output
+
+There are also a number of debugging flags; run the command with no arguments
+to get a usage message.
+
+*/
+package documentation
index f356906e50df015ab16e0ceca0d57d5f842c5133..c2818fc10ef1df88b2e6e294e741e42069627b92 100644 (file)
@@ -141,7 +141,7 @@ usage:
        print("  -h panic on an error\n");
        print("  -k name specify package name\n");
        print("  -o file specify output file\n");
-       print("  -p print the assembly language\n");
+       print("  -S print the assembly language\n");
        print("  -w print the parse tree after typing\n");
        print("  -x print lex tokens\n");
        exit(0);