Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – tendra.SVN – Blame – /branches/tendra4/doc/tcpplus/man.html – Rev 2

Subversion Repositories tendra.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
<!-- Crown Copyright (c) 1998 -->
2
<HTML>
3
<HEAD>
4
<TITLE>
5
C++ Producer Guide: Invocation 
6
</TITLE>
7
</HEAD>
8
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#400080" ALINK="#FF0000">
9
 
10
<H1>C++ Producer Guide</H1>
11
<H3>March 1998</H3>
12
<A HREF="pragma.html"><IMG SRC="../images/next.gif" ALT="next section"></A>
13
<A HREF="index.html"><IMG SRC="../images/prev.gif" ALT="previous section"></A>
14
<A HREF="index.html"><IMG SRC="../images/top.gif" ALT="current document"></A>
15
<A HREF="../index.html"><IMG SRC="../images/home.gif" ALT="TenDRA home page">
16
</A>
17
<IMG SRC="../images/no_index.gif" ALT="document index"><P>
18
<HR>
19
 
20
<DL>
21
<DT><A HREF="#compile"><B>2.1.1</B> - Compilation scheme</A><DD>
22
<DT><A HREF="#option"><B>2.1.2</B> - Producer options</A><DD>
23
</DL>
24
<HR>
25
 
26
<H2>2.1. Invocation</H2>
27
<P>
28
In this section it is described how the C++ to TDF producer, 
29
<CODE>tcpplus</CODE>, fits into the overall compilation scheme controlled
30
by the TenDRA compiler front-end, <CODE>tcc</CODE>, or the TenDRA
31
checker front-end, <CODE>tchk</CODE>.  While it is possible to use
32
<CODE>tcpplus</CODE> as a stand-alone program, it is recommended that
33
it should be invoked via <CODE>tcc</CODE> or <CODE>tchk</CODE>. The
34
<CODE>tcc</CODE> users' guide should be consulted for more details.
35
</P>
36
<P>
37
<CODE>tcc</CODE> and <CODE>tchk</CODE> require the <CODE>-Yc++</CODE>
38
command-line option in order to enable their C++ capabilities.  Files
39
with a <CODE>.C</CODE> suffix are recognised as C++ source files and
40
passed to <CODE>tcpplus</CODE> for processing (see 
41
<A HREF="#compile">below</A>).  It is possible to change the suffix
42
used for C++ source files; for example <CODE>-sC:cc</CODE> causes
43
<CODE>.cc</CODE> files to be recognised as C++ source files.  An interesting
44
variation is <CODE>-sC:c</CODE> which causes C source files to be
45
processed by the C++ producer.  Similarly <CODE>.I</CODE> files are
46
recognised as preprocessed C++ source files and <CODE>.K</CODE>
47
files are recognised as C++ spec files. 
48
</P>
49
<P>
50
Most of the command-line option handling for <CODE>tcpplus</CODE>
51
is done by <CODE>tcc</CODE> and <CODE>tchk</CODE>, however it is possible
52
to pass the option <I>opt</I> directly to <CODE>tcpplus</CODE> using
53
the option <CODE>-Wx,</CODE><I>opt</I> to <CODE>tcc</CODE> or <CODE>tchk</CODE>.
54
Similarly <CODE>-Wg,</CODE><I>opt</I> and <CODE>-WS,</CODE><I>opt</I>
55
can be used to pass options to the C++ preprocessor and the C++ spec
56
linker (both of which are actually <CODE>tcpplus</CODE> invoked with
57
different options) respectively. 
58
</P>
59
 
60
<HR>
61
<H3><A NAME="compile">2.1.1. Compilation scheme</A></H3>
62
<P>
63
The overall compilation scheme controlled by <CODE>tcc</CODE>, as
64
it relates to the C++ producer, can be represented as follows: 
65
<CENTER>
66
<IMG SRC="../images/compile.gif" ALT="compilation scheme">
67
</CENTER>
68
Each C++ source file, <CODE>a.C</CODE> say, is processed using 
69
<CODE>tcpplus</CODE> to give an output TDF capsule, <CODE>a.j</CODE>,
70
which is passed to the installer phase of <CODE>tcc</CODE>.  The capsule
71
is linked with any target dependent token definition libraries, translated
72
to assembler and assembled to give a binary object file, 
73
<CODE>a.o</CODE>.  The various object files comprising the program
74
are then linked with the system libraries to give a final executable,
75
<CODE>a.out</CODE>. 
76
</P>
77
<P>
78
In addition to this main compilation scheme, <CODE>tcpplus</CODE>
79
can additionally be made to output a <A HREF="link.html">C++ spec
80
file</A>
81
for each C++ source file, <CODE>a.K</CODE> say.  These C++ spec files
82
can be linked, using <CODE>tcpplus</CODE> in its spec linker mode,
83
to give an additional TDF capsule, <CODE>x.j</CODE> say, and a combined
84
C++ spec file, <CODE>x.K</CODE>.  The main purpose of this C++ spec
85
linking is to perform intermodule checks on the program, however in
86
the course of this checking exported templates which are defined in
87
one module and used in another are instantiated.  This extra code
88
is output to <CODE>x.j</CODE>, which is then installed and linked
89
in the normal way. 
90
</P>
91
<P>
92
Note that intermodule checks, and hence intermodule template instantiations,
93
are only performed if the <CODE>-im</CODE> option is passed to <CODE>tcc</CODE>.
94
</P>
95
<P>
96
The TenDRA checker, <CODE>tchk</CODE>, is similar to <CODE>tcc</CODE>
97
except that it disables TDF output and has intermodule analysis enabled
98
by default. 
99
</P>
100
 
101
<HR>
102
<H3><A NAME="option">2.1.2. Producer options</A></H3>
103
<P>
104
The general form for the invocation of <CODE>tcpplus</CODE> is as
105
follows: 
106
<PRE>
107
	tcpplus [ <I>options</I> ] [ <I>input-file</I> ] .... [ <I>output-file</I> ]
108
</PRE>
109
The output file can alternatively be specified using the 
110
<A HREF="#output"><CODE>-o</CODE> option</A>.  If no output file is
111
given, or the output file is <CODE>-</CODE>, the standard output is
112
used.  In general there can be any number of input files.  If no input
113
file is given, or the input file is <CODE>-</CODE>, the standard input
114
is used. 
115
</P>
116
<P>
117
<CODE>tcpplus</CODE> has three modes which determine the form of its
118
input and output files.  The default mode is compilation, in which
119
a single input C++ source file is translated into an output TDF capsule.
120
In preprocessing mode, specified using the 
121
<A HREF="#preproc"><CODE>-E</CODE> option</A>, a single input C++
122
source file is preprocessed into an output C++ source file.  Note
123
that the preprocessor is built into <CODE>tcpplus</CODE>, rather than,
124
as with most other compilers, being a separate program.  The final
125
mode is 
126
<A HREF="link.html">C++ spec linking</A>, specified using the 
127
<A HREF="#linker"><CODE>-S</CODE> option</A>.  Any number of C++ spec
128
input files are linked and any code generated as a result (for example,
129
template instantiations) is written to the output TDF capsule. 
130
</P>
131
<P>
132
In either compilation or spec linking mode, a C++ spec output file
133
can be generated, in addition to the TDF capsule, using the 
134
<A HREF="#spec"><CODE>-s</CODE> option</A>.  In any mode a symbol
135
table dump output file can generated using the <A HREF="#dump"><CODE>-d</CODE>
136
option</A>. 
137
</P>
138
<P>
139
Command-line options can appear in any order and can be interspersed
140
with the input and output files, except following a <CODE>--</CODE>
141
option.  All the multi-part options can be given either as one or
142
two command-line arguments, so that <CODE>-I</CODE><I>directory</I>
143
and 
144
<CODE>-I</CODE> <I>directory</I> are equivalent.  The recognised options
145
are as follows: 
146
</P>
147
 
148
<DL>
149
 
150
<DT><B>-A<I>predicate</I>(<I>tokens</I>)</B>
151
<DD>
152
Asserts that the given predicate is true, that is to say: 
153
<PRE>
154
	#assert <I>predicate</I> ( <I>tokens</I> )
155
</PRE>
156
The special case <CODE>-A-</CODE> undefines all the built-in predicates
157
(of which there are none).  Use of this option automatically enables
158
support for the <A HREF="pragma.html#ppdir"><CODE>#assert</CODE> and
159
<CODE>#unassert</CODE> directives</A>. 
160
<P>
161
 
162
<DT><B>-D<I>macro</I></B><DD>
163
<DT><B>-D<I>macro</I>=<I>tokens</I></B>
164
<DD>
165
Defines the given macro to be 1 in the first case, or the given sequence
166
of preprocessing tokens in the second case, that is to say: 
167
<PRE>
168
	#define <I>macro</I> 1
169
	#define <I>macro tokens</I>
170
</PRE>
171
respectively.  In fact <CODE>-D</CODE> and <CODE>-U</CODE> options
172
to 
173
<CODE>tcc</CODE> are not passed as <CODE>-D</CODE> and <CODE>-U</CODE>
174
options to <CODE>tcpplus</CODE>.  Instead a 
175
<A HREF="#start-up">start-up</A> file containing the equivalent 
176
<CODE>#define</CODE> and <CODE>#undef</CODE> directives is used. 
177
<P>
178
 
179
<DT><A NAME="preproc"><B>-E</B></A>
180
<DD>
181
Enables preprocessing mode in which the input C++ source file is preprocessed
182
into the output file. 
183
<P>
184
 
185
<DT><B>-F<I>file</I></B>
186
<DD>
187
Causes a list of command-line options to be read from <I>file</I>.
188
Other than empty lines and lines beginning with <CODE>#</CODE>, each
189
line in the file is treated as if it had been specified as a separate
190
command-line option. 
191
<P>
192
 
193
<DT><B>-H</B>
194
<DD>
195
Enables verbose inclusion mode in which warnings are printed at the
196
start and end of each included source file. 
197
<P>
198
 
199
<DT><B>-I<I>directory</I></B>
200
<DD>
201
Adds the given directory to the list searched for included source
202
files. No such directories are built into the producer by default.
203
<P>
204
 
205
<DT><A NAME="directory"><B>-N<I>name</I>:<I>directory</I></B></A>
206
<DD>
207
This is identical to <CODE>-I</CODE><I>directory</I> except that it
208
also associates the given identifier with the directory.  The directory
209
name can be used to specify a <A HREF="pragma.html#scope">compilation
210
profile</A> to be used on files included from this directory. 
211
<P>
212
 
213
<DT><A NAME="linker"><B>-S</B></A>
214
<DD>
215
Enables C++ spec linker mode, in which any number of C++ spec input
216
files are linked together. 
217
<P>
218
 
219
<DT><B>-U<I>macro</I></B>
220
<DD>
221
Undefines the given macro, that is to say: 
222
<PRE>
223
	#undef <I>macro</I>
224
</PRE>
225
The special case <CODE>-U-</CODE> undefines all the built-in macros.
226
These may be described as follows: 
227
<PRE>
228
	#define __FILE__		<I>(current file)</I>
229
	#define __LINE__		<I>(current line)</I>
230
	#define __TIME__		<I>(current time)</I>
231
	#define __DATE__		<I>(current date)</I>
232
	#define __STDC__		1
233
	#define __STDC_VERSION__	199409L
234
	#define __cplusplus		199711L
235
</PRE>
236
The actual value of <CODE>__cplusplus</CODE> gives the date of the
237
draft ISO C++ standard on which the current version of the producer
238
is based. The value given above gives the expected date of the final
239
C++ standard. 
240
<P>
241
 
242
<DT><B>-V</B>
243
<DD>
244
Causes the name of each function to be printed to the standard output
245
as it is compiled. 
246
<P>
247
 
248
<DT><B>-W<I>option</I></B>
249
<DD>
250
Sets the given <A HREF="pragma.html#low">compiler option</A> to give
251
a warning, that is to say: 
252
<PRE>
253
	#pragma TenDRA option &quot;<I>option</I>&quot; warning
254
</PRE>
255
The special case <CODE>-Wall</CODE> enables a wide range of warnings.
256
<P>
257
 
258
<DT><B>-X</B>
259
<DD>
260
Disables exception handling.  The <A HREF="lib.html#except">current
261
implementation</A> can be a large run-time overhead if not required.
262
The effect of linking any module compiled with this option with a
263
module which throws an exception is undefined.  This is equivalent
264
to <A HREF="#output"><CODE>-j-e</CODE></A>. 
265
<P>
266
 
267
<DT><B>-a</B>
268
<DD>
269
Causes complete program analysis to be applied.  That is to say it
270
is assumed that no other translation units need to be linked in order
271
for the program to execute. 
272
<P>
273
 
274
<DT><B>-c</B>
275
<DD>
276
Disables TDF output.  The output file will still be a valid TDF capsule,
277
but it will contain no information.  This is equivalent to 
278
<A HREF="#output"><CODE>-j-c</CODE></A>. 
279
<P>
280
 
281
<DT><A NAME="dump"><B>-d<I>opt</I>=<I>dump-file</I></B></A>
282
<DD>
283
Specifies the given file as a <A HREF="dump.html">symbol table dump</A>
284
output file.  <I>opt</I> will be a series of characters describing
285
the information to be dumped, as follows: 
286
<P>
287
<CENTER>
288
<TABLE BORDER>
289
<TR><TH>Key</TH>
290
<TH>Description</TH>
291
<TR><TD ALIGN=CENTER><CODE>a</CODE></TD>
292
<TD>equivalent to <CODE>ehlmu</CODE></TD>
293
<TR><TD ALIGN=CENTER><CODE>c</CODE></TD>
294
<TD>dump string literals</TD>
295
<TR><TD ALIGN=CENTER><CODE>e</CODE></TD>
296
<TD>dump error messages</TD>
297
<TR><TD ALIGN=CENTER><CODE>h</CODE></TD>
298
<TD>dump header information</TD>
299
<TR><TD ALIGN=CENTER><CODE>k</CODE></TD>
300
<TD>dump keyword identifiers</TD>
301
<TR><TD ALIGN=CENTER><CODE>l</CODE></TD>
302
<TD>dump local variables</TD>
303
<TR><TD ALIGN=CENTER><CODE>m</CODE></TD>
304
<TD>dump macro identifiers</TD>
305
<TR><TD ALIGN=CENTER><CODE>s</CODE></TD>
306
<TD>dump scope information</TD>
307
<TR><TD ALIGN=CENTER><CODE>u</CODE></TD>
308
<TD>dump identifier usage information</TD>
309
</TABLE>
310
</CENTER>
311
</P>
312
<P>
313
Note that these correspond to the <CODE>tcc -sym</CODE> options. 
314
</P>
315
 
316
<DT><A NAME="end-up"><B>-e<I>file</I></B></A>
317
<DD>
318
Specifies the given file as an end-up file.  This is equivalent to
319
adding: 
320
<PRE>
321
	#include &quot;<I>file</I>&quot;
322
</PRE>
323
at the end of the input source file.  More than one end-up file may
324
be given; they are processed in the order given. 
325
<P>
326
 
327
<DT><A NAME="start-up"><B>-f<I>file</I></B></A>
328
<DD>
329
Specifies the given file as a start-up file.  This is equivalent to
330
adding: 
331
<PRE>
332
	#include &quot;<I>file</I>&quot;
333
</PRE>
334
at the start of the input source file.  More than one start-up file
335
may be given; they are processed in the order given. 
336
<P>
337
 
338
<DT><B>-g</B>
339
<DD>
340
Specifies that the output TDF capsule should also contain information
341
to allow for the generation of run-time debugging directives.  This
342
is equivalent to <A HREF="#output"><CODE>-jg</CODE></A>. 
343
<P>
344
 
345
<DT><B>-h</B>
346
<DD>
347
Causes a full list of command-line options to be printed.  This includes
348
a number not documented here which are unlikely to prove useful to
349
the normal user. 
350
<P>
351
 
352
<DT><A NAME="output"><B>-j<I>opt</I></B></A>
353
<DD>
354
Sets the TDF output options given by <I>opt</I>.  This consists of
355
a sequence of characters describing the options to be enabled or disabled.
356
By default, or following a <CODE>+</CODE>, the options are enabled;
357
following a <CODE>-</CODE> they are disabled.  The available options
358
are as follows: 
359
<P>
360
<CENTER>
361
<TABLE BORDER>
362
<TR><TH>Key</TH>
363
<TH>Default</TH>
364
<TH>Description</TH>
365
<TR><TD ALIGN=CENTER><CODE>a</CODE></TD>
366
<TD ALIGN=CENTER>off</TD>
367
<TD>output external names for local objects</TD>
368
<TR><TD ALIGN=CENTER><CODE>b</CODE></TD>
369
<TD ALIGN=CENTER>off</TD>
370
<TD>work round old installer bugs</TD>
371
<TR><TD ALIGN=CENTER><CODE>c</CODE></TD>
372
<TD ALIGN=CENTER>on</TD>
373
<TD>output TDF capsule</TD>
374
<TR><TD ALIGN=CENTER><CODE>d</CODE></TD>
375
<TD ALIGN=CENTER>off</TD>
376
<TD>output termination function</TD>
377
<TR><TD ALIGN=CENTER><CODE>e</CODE></TD>
378
<TD ALIGN=CENTER>on</TD>
379
<TD>output exceptions</TD>
380
<TR><TD ALIGN=CENTER><CODE>f</CODE></TD>
381
<TD ALIGN=CENTER>on</TD>
382
<TD>mangle template function signatures</TD>
383
<TR><TD ALIGN=CENTER><CODE>g</CODE></TD>
384
<TD ALIGN=CENTER>off</TD>
385
<TD>output debugging information</TD>
386
<TR><TD ALIGN=CENTER><CODE>i</CODE></TD>
387
<TD ALIGN=CENTER>off</TD>
388
<TD>output dynamic initialisers as a function</TD>
389
<TR><TD ALIGN=CENTER><CODE>n</CODE></TD>
390
<TD ALIGN=CENTER>on</TD>
391
<TD>mangle object names</TD>
392
<TR><TD ALIGN=CENTER><CODE>o</CODE></TD>
393
<TD ALIGN=CENTER>off</TD>
394
<TD>order class data members by access</TD>
395
<TR><TD ALIGN=CENTER><CODE>p</CODE></TD>
396
<TD ALIGN=CENTER>on</TD>
397
<TD>output partial destructors</TD>
398
<TR><TD ALIGN=CENTER><CODE>r</CODE></TD>
399
<TD ALIGN=CENTER>on</TD>
400
<TD>output run-time type information</TD>
401
<TR><TD ALIGN=CENTER><CODE>s</CODE></TD>
402
<TD ALIGN=CENTER>on</TD>
403
<TD>output shared string literals</TD>
404
<TR><TD ALIGN=CENTER><CODE>t</CODE></TD>
405
<TD ALIGN=CENTER>off</TD>
406
<TD>output token declarations</TD>
407
<TR><TD ALIGN=CENTER><CODE>u</CODE></TD>
408
<TD ALIGN=CENTER>on</TD>
409
<TD>output unused static variables</TD>
410
<TR><TD ALIGN=CENTER><CODE>v</CODE></TD>
411
<TD ALIGN=CENTER>off</TD>
412
<TD>output local virtual function tables</TD>
413
</TABLE>
414
</CENTER>
415
</P>
416
 
417
<DT><A NAME="error"><B>-m<I>opt</I></B></A>
418
<DD>
419
Sets the error formatting options given by <I>opt</I>.  This consists
420
of a sequence of characters describing the options to be enabled or
421
disabled. By default, or following a <CODE>+</CODE>, the options are
422
enabled; following a <CODE>-</CODE> they are disabled.  The available
423
options are as follows: 
424
<P>
425
<CENTER>
426
<TABLE BORDER>
427
<TR><TH>Key</TH>
428
<TH>Default</TH>
429
<TH>Description</TH>
430
<TR><TD ALIGN=CENTER><CODE>c</CODE></TD>
431
<TD ALIGN=CENTER>off</TD>
432
<TD>show source code with error</TD>
433
<TR><TD ALIGN=CENTER><CODE>e</CODE></TD>
434
<TD ALIGN=CENTER>off</TD>
435
<TD>show error name</TD>
436
<TR><TD ALIGN=CENTER><CODE>f</CODE></TD>
437
<TD ALIGN=CENTER>on</TD>
438
<TD>reliable <CODE>fseek</CODE> function</TD>
439
<TR><TD ALIGN=CENTER><CODE>g</CODE></TD>
440
<TD ALIGN=CENTER>off</TD>
441
<TD>record statement locations</TD>
442
<TR><TD ALIGN=CENTER><CODE>i</CODE></TD>
443
<TD ALIGN=CENTER>on</TD>
444
<TD>reliable <CODE>stat</CODE> function</TD>
445
<TR><TD ALIGN=CENTER><CODE>k</CODE></TD>
446
<TD ALIGN=CENTER>off</TD>
447
<TD>enable C++ spec output</TD>
448
<TR><TD ALIGN=CENTER><CODE>l</CODE></TD>
449
<TD ALIGN=CENTER>off</TD>
450
<TD>output full error location</TD>
451
<TR><TD ALIGN=CENTER><CODE>s</CODE></TD>
452
<TD ALIGN=CENTER>on</TD>
453
<TD>output ISO section number</TD>
454
<TR><TD ALIGN=CENTER><CODE>t</CODE></TD>
455
<TD ALIGN=CENTER>off</TD>
456
<TD>use <CODE>typedef</CODE> names in errors</TD>
457
<TR><TD ALIGN=CENTER><CODE>w</CODE></TD>
458
<TD ALIGN=CENTER>off</TD>
459
<TD>disable warnings</TD>
460
<TR><TD ALIGN=CENTER><CODE>z</CODE></TD>
461
<TD ALIGN=CENTER>off</TD>
462
<TD>continue after error</TD>
463
</TABLE>
464
</CENTER>
465
</P>
466
 
467
<DT><A NAME="table"><B>-n<I>port-table</I></B></A>
468
<DD>
469
Specifies that the given <A HREF="pragma.html#table">portability table</A>
470
should be used to specify the basic configuration parameters. 
471
<P>
472
 
473
<DT><A NAME="output"><B>-o<I>output-file</I></B></A>
474
<DD>
475
Gives an alternative method of specifying the output file. 
476
<P>
477
 
478
<DT><B>-q</B>
479
<DD>
480
Causes the program to quit immediately without processing its input
481
files. This is useful primarily in version and command-line option
482
queries. 
483
<P>
484
 
485
<DT><A NAME="spec"><B>-s<I>spec-file</I></B></A>
486
<DD>
487
Specifies the given file as a C++ spec output file. 
488
<P>
489
 
490
<DT><B>-t</B>
491
<DD>
492
Specifies that token declarations should be included in the output
493
TDF capsule.  While these are strictly unnecessary, they help when
494
pretty-printing the output.  This is equivalent to 
495
<A HREF="#output"><CODE>-jt</CODE></A>. 
496
<P>
497
 
498
<DT><A NAME="unmangle"><B>-u</B></A>
499
<DD>
500
The form: 
501
<PRE>
502
	tcpplus -u <I>name</I> .... <I>name</I>
503
</PRE>
504
can be used to print the unmangled forms of a list of 
505
<A HREF="lib.html#mangle">mangled identifier names</A> to the standard
506
output. 
507
<P>
508
 
509
<DT><B>-v</B>
510
<DD>
511
Causes the C++ producer version number, plus information on the versions
512
of C++ and TDF supported, to be printed to the standard error. 
513
<P>
514
 
515
<DT><B>-w</B>
516
<DD>
517
Disables all warning messages.  This is equivalent to 
518
<A HREF="#error"><CODE>-mw</CODE></A>. 
519
<P>
520
 
521
<DT><B>-z</B>
522
<DD>
523
Forces an output file to be created even if compilation errors occur.
524
The effect of installing a TDF capsule produced using this option
525
is undefined.  This is equivalent to <A HREF="#error"><CODE>-mz</CODE></A>.
526
<P>
527
 
528
<DT><B>--</B>
529
<DD>
530
Marks the last option.  Any subsequent arguments are interpreted as
531
input and output files even if they resemble command-line options.
532
<P>
533
 
534
</DL>
535
 
536
<HR>
537
<P><I>Part of the <A HREF="../index.html">TenDRA Web</A>.<BR>Crown
538
Copyright &copy; 1998.</I></P>
539
</BODY>
540
</HTML>