File: languages.texi

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (36 lines) | stat: -rw-r--r-- 1,614 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
@c Copyright (C) 2002-2024 Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.

@node Languages
@chapter Language Front Ends in GCC

The interface to front ends for languages in GCC, and in particular
the @code{tree} structure (@pxref{GENERIC}), was initially designed for
C, and many aspects of it are still somewhat biased towards C and
C-like languages.  It is, however, reasonably well suited to other
procedural languages, and front ends for many such languages have been
written for GCC@.

Writing a compiler as a front end for GCC, rather than compiling
directly to assembler or generating C code which is then compiled by
GCC, has several advantages:

@itemize @bullet
@item GCC front ends benefit from the support for many different
target machines already present in GCC@.
@item GCC front ends benefit from all the optimizations in GCC@.  Some
of these, such as alias analysis, may work better when GCC is
compiling directly from source code than when it is compiling from
generated C code.
@item Better debugging information is generated when compiling
directly from source code than when going via intermediate generated C
code.
@end itemize

Because of the advantages of writing a compiler as a GCC front end,
GCC front ends have also been created for languages very different
from those for which GCC was designed, such as the declarative
logic/functional language Mercury.  For these reasons, it may also be
useful to implement compilers created for specialized purposes (for
example, as part of a research project) as GCC front ends.