Mercurial > hg > CbC > CbC_gcc
annotate gcc/doc/languages.texi @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 1830386684a0 |
children |
rev | line source |
---|---|
145 | 1 @c Copyright (C) 2002-2020 Free Software Foundation, Inc. |
0 | 2 @c This is part of the GCC manual. |
3 @c For copying conditions, see the file gcc.texi. | |
4 | |
5 @node Languages | |
6 @chapter Language Front Ends in GCC | |
7 | |
8 The interface to front ends for languages in GCC, and in particular | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
9 the @code{tree} structure (@pxref{GENERIC}), was initially designed for |
0 | 10 C, and many aspects of it are still somewhat biased towards C and |
11 C-like languages. It is, however, reasonably well suited to other | |
12 procedural languages, and front ends for many such languages have been | |
13 written for GCC@. | |
14 | |
15 Writing a compiler as a front end for GCC, rather than compiling | |
16 directly to assembler or generating C code which is then compiled by | |
17 GCC, has several advantages: | |
18 | |
19 @itemize @bullet | |
20 @item GCC front ends benefit from the support for many different | |
21 target machines already present in GCC@. | |
22 @item GCC front ends benefit from all the optimizations in GCC@. Some | |
23 of these, such as alias analysis, may work better when GCC is | |
24 compiling directly from source code then when it is compiling from | |
25 generated C code. | |
26 @item Better debugging information is generated when compiling | |
27 directly from source code than when going via intermediate generated C | |
28 code. | |
29 @end itemize | |
30 | |
31 Because of the advantages of writing a compiler as a GCC front end, | |
32 GCC front ends have also been created for languages very different | |
33 from those for which GCC was designed, such as the declarative | |
34 logic/functional language Mercury. For these reasons, it may also be | |
35 useful to implement compilers created for specialized purposes (for | |
36 example, as part of a research project) as GCC front ends. |