.\" $OpenBSD: ccom.1,v 1.3 2007/09/27 19:56:48 otto Exp $ ."\ .\" Copyright (c) 2007 Jeremy C. Reed .\" Permission to use, copy, modify, and/or distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR AND CONTRIBUTORS DISCLAIM .\" ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED .\" WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL AUTHOR AND .\" CONTRIBUTORS BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL .\" DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR .\" PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF .\" THIS SOFTWARE. .Dd September 14, 2007 .Dt ccom 1 .Os .Sh NAME .Nm ccom .Nd C compiler .Sh SYNOPSIS .Nm .Op Fl X Ar flags .Op infile .Op outfile .Pp .Sh DESCRIPTION The .Nm utility provides a C compiler. The frontend is usually .Xr pcc 1 . It is \fBnot\fR intended to be run directly. .Pp .Nm reads the C source from .Ar infile or standard input and writes the assembler source to .Ar outfile or to standard output. .Pp The options are as follows: .Bl -tag -width Ds .It Fl g Enable debugging. .\" built into binary, explain stabs? .It Fl s Print statistics to standard error when complete. This includes: name table entries, name string size, permanent allocated memory, temporary allocated memory, lost memory, argument list unions, dimension/function unions, struct/union/enum blocks, inline node count, inline control blocks, and permanent symtab entries. .\" TODO: explain units for above? .It Fl W Ar flags Report warnings. (Do some basic checks.) NOTE! These are subject to change RSN! .Ar Flags is one or more of the following: .Bl -tag -width Ds .It Sy implicit Implies .Sy implicit-int and .Sy implicit-function-declaration . .It Sy implicit-int TODO .It Sy implicit-function-declaration Report if no prototype for function. .It Sy missing-prototypes TODO .It Sy strict-prototypes TODO .El .\" .It Fl x Ar optimizations .Ar optimizations is one or more of the following: .Bl -tag -width deljumps .It Sy deljumps Delete redundant jumps and dead code. .It Sy ssa Convert statements into SSA form for optimization. Not yet finished. .It Sy tailcall Currently not implemented. .It Sy temps Setting this flag allow variables to be put into registers, for further optimization by the register allocator. .El .\" .It Fl X Ar C specific debugging flags .Ar Flags is one or more of the following: .Bl -tag -width Ds .It Sy b Building of parse trees .It Sy d Declarations, more d gives more output .It Sy t Type conversions .It Sy i Initializations .It Sy e Pass1 trees at exit .It Sy x Target-specific flag, used in machine-dependent code .El .\" .It Fl Z Ar Code generator (pass2) specific debugging flags .Ar Flags is one or more of the following: .Bl -tag -width Ds .It Sy e Trees when entering pass2 .It Sy o Instruction generator .It Sy f Instruction matcher, may provide much output .It Sy r Register allocator .It Sy t Type matching in instruction generator .It Sy s Shape matching in instruction generator .It Sy u Sethi-Ullman computations .It Sy x Target-specific flag, used in machine-dependent code .El .Sh SEE ALSO .Xr as 1 , .Xr cpp 1 , .Xr pcc 1 .Sh HISTORY The .Nm compiler is based on the original Portable C Compiler by S. C. Johnson, written in the late 70's. Even though much of the compiler has been rewritten, some of the basics still remain. About 50% of the frontend code and 80% of the backend code has been rewritten. Most is written by Anders Magnusson, with the exception of the data-flow analysis part and the SSA conversion code which is written by Peter A Jonsson, and the Mips port that were written as part of a project by undergraduate students at Lulea University of Technology.