Invoking the Tools Individually
2-42
2.9.2 Parsing in Two Passes
Compiling very large source programs on small host systems such as PCs can
cause the compiler to run out of memory and fail. You can avoid host memory
limitations by running the parser as two separate passes. The first pass can
preprocess the file, and the second pass can parse the file.
When you run the parser as one pass, it uses host memory to store both macro
definitions and symbol definitions simultaneously. When you run the parser as
two passes, these functions can be separated. The first pass performs only
preprocessing and memory is needed only for macro definitions. In the second
pass, there are no macro definitions and memory is needed only for the sym-
bol table.
The following example illustrates how to run the parser as two passes:
1) Run the parser with the
−
po option, specifying preprocessing only.
dspcl −po file.c
If you want to use the
−
d,
−
u, or
−
i options, use them on this first pass. This
pass produces a preprocessed output file called file.pp. For more
information about the preprocessor, see section 2.5,
Controlling the Pre-
processor,
2) Rerun the whole compiler on the preprocessed file to finish compiling it.
dspcl file.pp
You can use any other options on this final pass.
2.9.3 Invoking the Optimizer
Optimizing is an optional second step in compiling a TMS320C2x/C2xx/C5x
C program. After parsing a C source file, you can choose to process the inter-
mediate file with the optimizer. The optimizer improves the execution speed
and reduces the size of C programs. The optimizer reads the intermediate file,
optimizes it according to the level you choose, and produces an intermediate
file. The intermediate file has the same format as the original intermediate file,
but it enables the code generator to produce more efficient code.
Summary of Contents for TMS320C2x
Page 8: ...viii...
Page 69: ...2 47 C Compiler Description...
Page 159: ...6 36...
Page 226: ...8 6...