|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | 28-Jul-2021 | - |
| LICENSE | H A D | 28-Jul-2021 | 1.4 KiB | 28 | 24 |
| MERGE | H A D | 28-Jul-2021 | 155 | 5 | 3 |
| PATENTS | H A D | 28-Jul-2021 | 1.3 KiB | 23 | 20 |
| README | H A D | 28-Jul-2021 | 2.3 KiB | 57 | 44 |
| ast-dump.cc | H A D | 28-Jul-2021 | 23.8 KiB | 968 | 755 |
| ast-dump.h | H A D | 28-Jul-2021 | 2.6 KiB | 123 | 62 |
| backend.h | H A D | 28-Jul-2021 | 32 KiB | 787 | 278 |
| embed.cc | H A D | 28-Jul-2021 | 20.4 KiB | 948 | 755 |
| escape.cc | H A D | 28-Jul-2021 | 104.1 KiB | 3,479 | 2,690 |
| escape.h | H A D | 28-Jul-2021 | 12.9 KiB | 507 | 285 |
| export.cc | H A D | 28-Jul-2021 | 41.7 KiB | 1,480 | 1,033 |
| export.h | H A D | 28-Jul-2021 | 10.8 KiB | 418 | 243 |
| expressions.cc | H A D | 28-Jul-2021 | 562.8 KiB | 19,911 | 15,735 |
| expressions.h | H A D | 28-Jul-2021 | 116.2 KiB | 4,607 | 2,821 |
| go-diagnostics.cc | H A D | 28-Jul-2021 | 4.6 KiB | 200 | 154 |
| go-diagnostics.h | H A D | 28-Jul-2021 | 3 KiB | 77 | 33 |
| go-dump.cc | H A D | 28-Jul-2021 | 961 | 54 | 32 |
| go-dump.h | H A D | 28-Jul-2021 | 997 | 39 | 17 |
| go-encode-id.cc | H A D | 28-Jul-2021 | 7.4 KiB | 358 | 293 |
| go-encode-id.h | H A D | 28-Jul-2021 | 1,016 | 33 | 12 |
| go-linemap.h | H A D | 28-Jul-2021 | 5 KiB | 165 | 83 |
| go-optimize.cc | H A D | 28-Jul-2021 | 1.1 KiB | 54 | 32 |
| go-optimize.h | H A D | 28-Jul-2021 | 1.1 KiB | 39 | 17 |
| go-sha1.h | H A D | 28-Jul-2021 | 1 KiB | 34 | 13 |
| go.cc | H A D | 28-Jul-2021 | 5.4 KiB | 209 | 123 |
| gogo.cc | H A D | 28-Jul-2021 | 273.2 KiB | 9,697 | 7,258 |
| gogo.h | H A D | 28-Jul-2021 | 107.9 KiB | 3,934 | 2,193 |
| import-archive.cc | H A D | 28-Jul-2021 | 23.4 KiB | 927 | 694 |
| import.cc | H A D | 28-Jul-2021 | 46 KiB | 1,755 | 1,323 |
| import.h | H A D | 28-Jul-2021 | 18.7 KiB | 777 | 445 |
| lex.cc | H A D | 28-Jul-2021 | 71.9 KiB | 3,073 | 2,675 |
| lex.h | H A D | 28-Jul-2021 | 14.1 KiB | 587 | 384 |
| names.cc | H A D | 28-Jul-2021 | 37.7 KiB | 1,279 | 775 |
| operator.h | H A D | 28-Jul-2021 | 1.5 KiB | 67 | 54 |
| parse.cc | H A D | 28-Jul-2021 | 165.3 KiB | 5,973 | 4,772 |
| parse.h | H A D | 28-Jul-2021 | 10.4 KiB | 325 | 238 |
| runtime.cc | H A D | 28-Jul-2021 | 11.5 KiB | 472 | 336 |
| runtime.def | H A D | 28-Jul-2021 | 22.2 KiB | 592 | 452 |
| runtime.h | H A D | 28-Jul-2021 | 1.1 KiB | 52 | 27 |
| statements.cc | H A D | 28-Jul-2021 | 210.2 KiB | 7,379 | 5,446 |
| statements.h | H A D | 28-Jul-2021 | 54.3 KiB | 2,245 | 1,376 |
| string-dump.h | H A D | 28-Jul-2021 | 724 | 26 | 11 |
| types.cc | H A D | 28-Jul-2021 | 345.2 KiB | 12,789 | 9,664 |
| types.h | H A D | 28-Jul-2021 | 97.6 KiB | 3,825 | 2,228 |
| unsafe.cc | H A D | 28-Jul-2021 | 2.8 KiB | 95 | 69 |
| wb.cc | H A D | 28-Jul-2021 | 33.8 KiB | 1,101 | 779 |
README
1See ../README.
2
3The frontend is written in C++. It can only be used in conjunction
4with a full compiler backend. Currently the backend interface has
5been implemented with GCC (known as gccgo) and with LLVM (known as
6GoLLVM).
7
8The frontend lexes and parses the input into an IR specific to this
9frontend known as gogo. It then runs a series of passes over the
10code.
11
12Finally it converts gogo to the backend IR. This is done via the
13interface described in backend.h. The backend must implement that
14interface. When used with GCC, the interface is implemented in
15gcc/go/go-gcc.cc.
16
17Source locations are represented using the interface described in
18go-linemap.h. The backend is expected to provide a header file
19go-location.h that defines a Location type.
20
21The frontend does not start by itself. It expects something to call
22go_create_gogo passing in a Backend and a Linemap, as well as other
23options. Then it expects something to call go_parse_input_files
24passing in the input files. Finally, a call to go_write_globals will
25cause all global definitions to be written out via the Backend
26interface.
27
28The backend is expected to provide the functions defined at the
29bottom of go-diagnostics.h: go_be_error_at, etc. These will be used
30for error messages.
31
32This compiler works, but the code is a work in progress. The frontend
33pays little attention to its memory usage and rarely frees any memory.
34The code could use a general cleanup which we have not had time to do.
35
36Contributing
37=============
38
39To contribute patches to the files in this directory, please see
40https://golang.org/doc/gccgo_contribute.html .
41
42The master copy of these files is hosted at
43https://go.googlesource.com/gofrontend . There is a mirror at
44https://github.com/golang/gofrontend . Changes to these files require
45signing a Google contributor license agreement. If you are the
46copyright holder, you will need to agree to the individual contributor
47https://cla.developers.google.com/about/google-individual . This
48agreement can be completed online.
49
50If your organization is the copyright holder, the organization will
51need to agree to the corporate contributor license agreement at
52https://cla.developers.google.com/about/google-corporate .
53
54If the copyright holder for your code has already completed the
55agreement in connection with another Google open source project, it
56does not need to be completed again.
57