1 | .\" $NetBSD$
|
---|
2 | .\" $Id: ccom.1,v 1.9 2010/04/05 13:13:57 reed Exp $
|
---|
3 | .\"
|
---|
4 | .\" Copyright (c) 2007 Jeremy C. Reed <reed@reedmedia.net>
|
---|
5 | .\" Permission to use, copy, modify, and/or distribute this software for any
|
---|
6 | .\" purpose with or without fee is hereby granted, provided that the above
|
---|
7 | .\" copyright notice and this permission notice appear in all copies.
|
---|
8 | .\"
|
---|
9 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR AND CONTRIBUTORS DISCLAIM
|
---|
10 | .\" ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
---|
11 | .\" WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL AUTHOR AND
|
---|
12 | .\" CONTRIBUTORS BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
---|
13 | .\" DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
---|
14 | .\" PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
---|
15 | .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
---|
16 | .\" THIS SOFTWARE.
|
---|
17 | .Dd September 14, 2007
|
---|
18 | .Dt CCOM 1
|
---|
19 | .Os
|
---|
20 | .Sh NAME
|
---|
21 | .Nm ccom
|
---|
22 | .Nd C compiler
|
---|
23 | .Sh SYNOPSIS
|
---|
24 | .Nm
|
---|
25 | .Op Fl gs
|
---|
26 | .Op Fl W Ar flags
|
---|
27 | .Op Fl X Ar flags
|
---|
28 | .Op Fl x Ar optimizations
|
---|
29 | .Op Fl Z Ar flags
|
---|
30 | .Op infile
|
---|
31 | .Op outfile
|
---|
32 | .Sh DESCRIPTION
|
---|
33 | The
|
---|
34 | .Nm
|
---|
35 | utility provides a C compiler.
|
---|
36 | The frontend is usually
|
---|
37 | .Xr pcc 1 .
|
---|
38 | It is
|
---|
39 | .Em not
|
---|
40 | intended to be run directly.
|
---|
41 | .Pp
|
---|
42 | .Nm
|
---|
43 | reads the C source from
|
---|
44 | .Ar infile
|
---|
45 | or standard input and writes the assembler source
|
---|
46 | to
|
---|
47 | .Ar outfile
|
---|
48 | or to standard output.
|
---|
49 | .Pp
|
---|
50 | The options are as follows:
|
---|
51 | .Bl -tag -width Ds
|
---|
52 | .It Fl g
|
---|
53 | Enable debugging.
|
---|
54 | .\" built into binary, explain stabs?
|
---|
55 | .It Fl k
|
---|
56 | Generate PIC code.
|
---|
57 | .It Fl s
|
---|
58 | Print statistics to standard error when complete.
|
---|
59 | This includes:
|
---|
60 | name table entries, name string size, permanent allocated memory,
|
---|
61 | temporary allocated memory, lost memory, argument list unions,
|
---|
62 | dimension/function unions, struct/union/enum blocks, inline node count,
|
---|
63 | inline control blocks, and permanent symtab entries.
|
---|
64 | .\" TODO: explain units for above?
|
---|
65 | .It Fl v
|
---|
66 | Display version.
|
---|
67 | .It Fl W Ar flags
|
---|
68 | Report warnings.
|
---|
69 | (Do some basic checks.)
|
---|
70 | .Em NOTE!
|
---|
71 | .Em These are subject to change RSN!
|
---|
72 | .Ar flags
|
---|
73 | is one or more of the following:
|
---|
74 | .Bl -tag -width Ds
|
---|
75 | .It Sy error
|
---|
76 | Report all warnings as errors.
|
---|
77 | .It Sy implicit
|
---|
78 | Implies
|
---|
79 | .Sy implicit-function-declaration
|
---|
80 | and
|
---|
81 | .Sy implicit-int .
|
---|
82 | .It Sy implicit-function-declaration
|
---|
83 | Report if no prototype was declared for a function.
|
---|
84 | .It Sy implicit-int
|
---|
85 | TODO
|
---|
86 | .It Sy missing-prototypes
|
---|
87 | TODO
|
---|
88 | .It Sy strict-prototypes
|
---|
89 | TODO
|
---|
90 | .It Sy W
|
---|
91 | Enable all warnings.
|
---|
92 | .El
|
---|
93 | .\"
|
---|
94 | .It Fl X Ar flags
|
---|
95 | C specific debugging where
|
---|
96 | .Ar flags
|
---|
97 | is one or more of the following:
|
---|
98 | .Bl -tag -width Ds
|
---|
99 | .It Sy b
|
---|
100 | Building of parse trees
|
---|
101 | .It Sy d
|
---|
102 | Declarations (using multiple
|
---|
103 | .Sy d
|
---|
104 | flags gives more output)
|
---|
105 | .It Sy e
|
---|
106 | Pass1 trees at exit
|
---|
107 | .It Sy i
|
---|
108 | Initializations
|
---|
109 | .It Sy n
|
---|
110 | Memory allocations
|
---|
111 | .It Sy o
|
---|
112 | Turn off optimisations
|
---|
113 | .It Sy p
|
---|
114 | Prototypes
|
---|
115 | .It Sy s
|
---|
116 | Inlining
|
---|
117 | .It Sy t
|
---|
118 | Type conversions
|
---|
119 | .It Sy x
|
---|
120 | Target-specific flag, used in machine-dependent code
|
---|
121 | .El
|
---|
122 | .\"
|
---|
123 | .It Fl x Ar optimizations
|
---|
124 | .Ar optimizations
|
---|
125 | is one of the following:
|
---|
126 | .\" TODO: reword this, since multiple terms don't go with one -x switch??
|
---|
127 | .Bl -tag -width deljumps
|
---|
128 | .It Sy deljumps
|
---|
129 | Delete redundant jumps and dead code.
|
---|
130 | .It Sy ssa
|
---|
131 | Convert statements into SSA form for optimization.
|
---|
132 | Not yet finished.
|
---|
133 | .It Sy tailcall
|
---|
134 | Currently not implemented.
|
---|
135 | .It Sy temps
|
---|
136 | Setting this flag allows variables to be put into registers, for further
|
---|
137 | optimization by the register allocator.
|
---|
138 | .El
|
---|
139 | The
|
---|
140 | .Fl x
|
---|
141 | flag can be passed multiple times to set different options.
|
---|
142 | .\"
|
---|
143 | .It Fl Z Ar flags
|
---|
144 | Code generator (pass2) specific debugging where
|
---|
145 | .Ar flags
|
---|
146 | is one or more of the following:
|
---|
147 | .Bl -tag -width Ds
|
---|
148 | .It Sy b
|
---|
149 | Basic block and SSA building
|
---|
150 | .It Sy c
|
---|
151 | Code printout
|
---|
152 | .It Sy e
|
---|
153 | Trees when entering pass2
|
---|
154 | .It Sy f
|
---|
155 | Instruction matcher, may provide much output
|
---|
156 | .It Sy n
|
---|
157 | Memory allocation
|
---|
158 | .It Sy o
|
---|
159 | Instruction generator
|
---|
160 | .It Sy r
|
---|
161 | Register allocator
|
---|
162 | .It Sy s
|
---|
163 | Shape matching in instruction generator
|
---|
164 | .It Sy t
|
---|
165 | Type matching in instruction generator
|
---|
166 | .It Sy u
|
---|
167 | Sethi-Ullman computations
|
---|
168 | .It Sy x
|
---|
169 | Target-specific flag, used in machine-dependent code
|
---|
170 | .El
|
---|
171 | .El
|
---|
172 | .Sh SEE ALSO
|
---|
173 | .Xr as 1 ,
|
---|
174 | .Xr cpp 1 ,
|
---|
175 | .Xr pcc 1
|
---|
176 | .Sh HISTORY
|
---|
177 | The
|
---|
178 | .Nm
|
---|
179 | compiler is based on the original Portable C Compiler by S. C. Johnson,
|
---|
180 | written in the late 70's.
|
---|
181 | Even though much of the compiler has been rewritten, some of the
|
---|
182 | basics still remain.
|
---|
183 | About 50% of the frontend code and 80% of the backend code has been
|
---|
184 | rewritten.
|
---|
185 | Most is written by Anders Magnusson, with the exception of
|
---|
186 | the data-flow analysis part and the SSA conversion code which is
|
---|
187 | written by Peter A Jonsson, and the Mips port that were written as
|
---|
188 | part of a project by undergraduate students at Lulea University of
|
---|
189 | Technology.
|
---|
190 | .Pp
|
---|
191 | This product includes software developed or owned by Caldera
|
---|
192 | International, Inc.
|
---|