kxlc/kcc(V1.1) KAP for IBM C (Kuck & Associates) kxlc/kcc(V1.1)
Name
kxlc - Driver to Run KAP with the IBM AIX XL C compiler,
using ANSI C syntax
kcc - Driver to Run KAP with the IBM AIX XL C compiler,
using IBM Extended C syntax
Syntax
kxlc [ options ] filename(s)
kcc [ options ] filename(s)
Description
kxlc and kcc can be used in place of xlc and cc
respectively, to incorporate the KAP high-level optimizer
into the C compilation process. These commands invoke a
series of language translators for the compilation of C
programs. kxlc invokes KAP and the IBM C compiler while kcc
invokes KAP and the IBM CC compiler. For each input file,
the translators are executed in the following order by
default:
* C pre-processor
* KAP high-level optimizer
* C compiler
The execution of each of the translators can be controlled
by the user by setting the appropriate command line options.
Options which apply to the preprocessor and the high-level
optimizer are recognized and passed accordingly. Compiler
options and unrecognized options are passed to the compiler
only. Files with unrecognized extensions will be passed to
the compiler untouched. The path strings shown below must
be enclosed in single or double quotes if they contain white
space characters. To use KAPped files in the debugger,
specify both -g and +Ksif.
Options
+K{0,1,2,3,4,5}
Default: +K3
This option sets the level of optimization for KAP
and the compiler. In general, the level of KAP
and compiler optimization increases as the setting
increases.
kcc/kxlc option KAP command line switch
+K0 -r=0 -so=0 -o=0 (few optimizations, for debug only)
+K1 -r=1 -so=2 -o=4 -arl=1
+K2 -r=2 -so=2 -o=4 -arl=1
+K3 -r=3 -so=3 -o=5 -arl=1
+K4 -r=3 -so=3 -o=5 -arl=1 -stdio *
+K5 -r=3 -so=3 -o=5 -arl=1 -stdio -inline *
* program must not use own versions of stdio functions such as printf.
+Kargs=kap_option_string
This option passes KAP command line options to the
KAP C high-level optimizer. Multiple options are
separated by colons.
+K[no]cc[=C_compiler_path]
Default for kxlc: +Kcc=/usr/bin/xlc
Default for kcc: +Kcc=/usr/bin/cc
This option controls the execution of the C
compiler (+Kcc=compiler path).
+Kcext=C_file_extension_string
Default: +Kcext=c
Treat files with the indicated extension as C
source files.
+K[no]cpp[=cpp_path]
Default for kxlc: +Kcpp=/usr/bin/xlc
Default for kcc: +Kcpp=/usr/bin/cc
This option controls the execution of the XL C or
cc pre-processor before the high-level optimizer.
The cpp may be bypassed (+Knocpp), or a particular
preprocessor specified (+Kcpp=cpp_path).
+Kinff=<file1>.c[:<file2>.c[:<file3>.c [...] ] ]
Default: off
This option tells the driver to handle inlining
from files in the following way:
o Preprocess each of the files specified with
+Kinff.
o KAP them using the default arguments as
well as those arguments set by +Kargs, and
save the results in <file>.inff.c.
o Then add
-inff=<file1>.inff.c[,<file2>.inff.c[,...]] to
the list of KAP arguments for
each of the input files specified on the
command line.
This option should not be specified more than once
on the command line.
When using +Kinff, -inff should not be passed to KAP
using +Kargs.
Note: If the file(s) specified with +Kinff do not
exist, KAP will be unable to process any of the
files since it requires the files specified by -inff
to exist.
+K[no]kapc[=C_kap_path]
Default: +Kkapc=/usr/bin/kapc
This option controls the execution of the KAP C
high-level optimizer. KAP may be bypassed
(+Knokapc) or a particular KAP specified
(+Kkapc=kapc_path).
+Klist
Default: +Klist
KAP will create a KAP listing file with the name
of K<name>.out.
+K[no]match
Default: +Kmatch
This option tells the driver to match the IBM
compiler options specified on the command line
with the appropriate KAP options.
+Kmatch uses the following mapping of compiler
options to KAP options:
-# KAP is not invoked, but command line is shown
-qhalt +Knokapc
-qlanglvl=ansi +Kargs=-syntax=ansi
-qlanglvl=extended +Kargs=-syntax=<default>
-qlistopt +Kargs=-list: -listoptions=k
-qnoprint +Kargs=-nolist
-P invoke first preprocessor pass with -P only
-E invoke preprocessor pass with -E only
-v echo commands invoked by the driver
Also, non-KAP pragmas will cause KAP to by bypassed.
+Ksif
Default: off
Save KAP intermediate files in the current
directory. The intermediate files are named as
follows:
K<name>.c - KAP C output file
K<name>.cpp - preprocessor output file
+Ktmpdir=temporary_directory_path_string
Default: +Ktmpdir=. /
This is the directory where KAP will place
temporary files. This option may also be set by
the environment variable TMPDIR.
FILES
file.c - input C file
Kfile.out - output KAP listing file
file.o - output object file
Kfile.c - KAP output file when +Ksif specified
Performance examples:kxlc test.c -o test.out
kxlc +K4 -O3 +Kargs=-ur=4:-arl=3 b.c
Debugging example:kxlc +Ksif -g b.c
Profiling example:kcc *.c -pg +Ksif +Kargs=-r=0
SEE ALSO
cpp
xlc
cc(1)
KAP User's Guide
KAP C man page
kapc(V1.0)