2
@node Compiler Definitions, Function and Variable Index, Miscellaneous, Top
3
@chapter Compiler Definitions
5
@defun EMIT-FN (turn-on)
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.
16
@defvar *CMPINCLUDE-STRING*
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.
24
@defun EMIT-FN (turn-on)
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
36
(compile-file "foo1.lisp")
37
(compile-file "foo2.lisp")
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
49
@defun MAKE-ALL-PROCLAIMS (&rest directories)
53
For each D in DIRECTORIES all files in (directory D) are loaded.
56
(make-all-proclaims "lsp/*.fn" "cmpnew/*.fn")
57
would load any files in lsp/*.fn and cmpnew/*.fn.
59
[See EMIT-FN for details on creation of .fn files]
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.
66
Finally a file sys-proclaim.lisp is written out. This file contains function
69
(load "sys-proclaim.lisp")
70
(compile-file "foo1.lisp")
71
(compile-file "foo2.lisp")
77
@defun MAKE-PROCLAIMS (&optional (stream *standard-output*))
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.
87
@defun LIST-UNDEFINED-FUNCTIONS ()
91
Return a list of all functions called but not defined, in the current data
97
(compile-file "foo1.lisp")
98
(compiler::list-undefined-functions)
100
(mapcar 'load (directory "*.fn")) (compiler::list-undefined-functions)
105
@defun WHO-CALLS (function-name)
109
List all functions in the data base [see emit-fn] which call FUNCTION-NAME.
113
@defun LIST-UNCALLED-FUNCTIONS ()
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.
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.
133
@defvar *SPLIT-FILES*
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.
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.
150
@defvar *COMPILE-ORDINARIES*
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.