~ubuntu-branches/ubuntu/vivid/gcl/vivid

« back to all changes in this revision

Viewing changes to info/compiler-defs.texi

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2002-03-04 14:29:59 UTC
  • Revision ID: james.westby@ubuntu.com-20020304142959-dey14w08kr7lldu3
Tags: upstream-2.5.0.cvs20020219
ImportĀ upstreamĀ versionĀ 2.5.0.cvs20020219

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
@node Compiler Definitions, Function and Variable Index, Miscellaneous, Top
 
3
@chapter Compiler Definitions
 
4
 
 
5
@defun EMIT-FN (turn-on)
 
6
Package:COMPILER
 
7
 
 
8
If TURN-ON is t, the subsequent calls to  COMPILE-FILE will
 
9
cause compilation of foo.lisp to emit a foo.fn as well as foo.o.
 
10
The .fn file contains cross referencing information as well as
 
11
information useful to the collection utilities in cmpnew/collectfn
 
12
This latter file must be manually loaded to call emit-fn.
 
13
 
 
14
 
 
15
@end defun
 
16
@defvar *CMPINCLUDE-STRING* 
 
17
Package:COMPILER
 
18
If it is a string it holds the text of the cmpinclude.h file appropriate for
 
19
this version.  Otherwise the usual #include of *cmpinclude* will be used.  To
 
20
disable this feature set *cmpinclude-string* to NIL in the init-form.
 
21
 
 
22
 
 
23
@end defvar
 
24
@defun EMIT-FN (turn-on)
 
25
Package:COMPILER
 
26
 
 
27
 
 
28
If TURN-ON is t, then subsequent calls to compile-file on a file foo.lisp
 
29
cause output of a file foo.fn.  This .fn file contains lisp structures
 
30
describing the functions in foo.lisp.  Some tools for analyzing this data base
 
31
are WHO-CALLS, LIST-UNDEFINED-FUNCTIONS, LIST-UNCALLED-FUNCTIONS, and
 
32
MAKE-PROCLAIMS.
 
33
 
 
34
Usage:
 
35
(compiler::emit-fn t)
 
36
(compile-file "foo1.lisp")
 
37
(compile-file "foo2.lisp")
 
38
 
 
39
This would create foo1.fn and foo2.fn.  These may be loaded using LOAD.  Each
 
40
time compile-file is called the data base is cleared.  Immediately after the
 
41
compilation, the data base consists of data from the compilation.  Thus if you
 
42
wished to find functions called but not defined in the current file, you could
 
43
do (list-undefined-functions), immediately following the compilation.  If you
 
44
have a large system, you would load all the .fn files before using the above
 
45
tools.
 
46
 
 
47
 
 
48
@end defun
 
49
@defun MAKE-ALL-PROCLAIMS (&rest directories)
 
50
Package:COMPILER
 
51
 
 
52
 
 
53
For each D in DIRECTORIES all files in (directory D) are loaded.
 
54
 
 
55
For example 
 
56
(make-all-proclaims "lsp/*.fn" "cmpnew/*.fn")
 
57
would load any files in lsp/*.fn and cmpnew/*.fn.
 
58
 
 
59
[See EMIT-FN for details on creation of .fn files] 
 
60
 
 
61
Then calculations on the newly loaded .fn files are made, to determine
 
62
function proclamations.  If number of values of a function cannot be
 
63
determined [for example because of a final funcall, or call of a function
 
64
totally unknown at this time] then return type * is assigned.
 
65
 
 
66
Finally a file sys-proclaim.lisp is written out.  This file contains function
 
67
proclamations.
 
68
 
 
69
(load "sys-proclaim.lisp")
 
70
(compile-file "foo1.lisp")
 
71
(compile-file "foo2.lisp")
 
72
 
 
73
 
 
74
 
 
75
 
 
76
@end defun
 
77
@defun MAKE-PROCLAIMS (&optional (stream *standard-output*))
 
78
Package:COMPILER
 
79
 
 
80
 
 
81
Write to STREAM the function proclaims from the current data base.  Usually a
 
82
number of .fn files are loaded prior to running this.  See EMIT-FN for details
 
83
on how to collect this.  Simply use LOAD to load in .fn files.
 
84
 
 
85
 
 
86
@end defun
 
87
@defun LIST-UNDEFINED-FUNCTIONS ()
 
88
Package:COMPILER
 
89
 
 
90
 
 
91
Return a list of all functions called but not defined, in the current data
 
92
base (see EMIT-FN).
 
93
 
 
94
@example
 
95
Sample:
 
96
(compiler::emit-fn t)
 
97
(compile-file "foo1.lisp")
 
98
(compiler::list-undefined-functions)
 
99
or
 
100
(mapcar 'load (directory "*.fn")) (compiler::list-undefined-functions)
 
101
 
 
102
@end example
 
103
 
 
104
@end defun
 
105
@defun WHO-CALLS  (function-name)
 
106
Package:COMPILER
 
107
 
 
108
 
 
109
List all functions in the data base [see emit-fn] which call FUNCTION-NAME.
 
110
 
 
111
 
 
112
@end defun
 
113
@defun LIST-UNCALLED-FUNCTIONS ()
 
114
Package:COMPILER
 
115
 
 
116
 
 
117
Examine the current data base [see emit-fn] for any functions or macros which
 
118
are called but are not: fboundp, OR defined in the data base, OR having
 
119
special compiler optimizer properties which would eliminate an actual call.
 
120
 
 
121
 
 
122
 
 
123
 
 
124
@end defun
 
125
@defvar *CC* 
 
126
Package:COMPILER
 
127
Has value a string which controls which C compiler is used by GCL.
 
128
Usually this string is obtained from the machine.defs file, but
 
129
may be reset by the user, to change compilers or add an include path.
 
130
 
 
131
 
 
132
@end defvar
 
133
@defvar *SPLIT-FILES* 
 
134
Package:COMPILER
 
135
This affects the behaviour of compile-file, and is useful for cases where
 
136
the C compiler cannot handle large C files resulting from lisp compilation.
 
137
This scheme should allow arbitrarily long lisp files to be compiled.
 
138
 
 
139
If the  value [default NIL] is a positive integer, then the source file will
 
140
be compiled into several object files whose names have 0,1,2,.. prepended,
 
141
and which will be loaded by the main object file.     File 0 will
 
142
contain compilation of top level forms thru position *split-files* in the
 
143
lisp source file, and file 1 the next forms, etc.   Thus a 180k file
 
144
would probably result in three object files (plus the master object file
 
145
of the same name) if *split-files* was set to 60000.
 
146
The package information will be inserted in each file.
 
147
 
 
148
 
 
149
@end defvar
 
150
@defvar *COMPILE-ORDINARIES* 
 
151
Package:COMPILER
 
152
If this has a non nil value [default = nil], then all top level
 
153
forms will be compiled into machine instructions.    Otherwise
 
154
only defun's, defmacro's, and top level forms beginning
 
155
with (progn 'compile ...) will do so.
 
156
 
 
157
 
 
158
@end defvar