| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 2 |
<html> |
| 3 |
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ --> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 6 |
<title>Compiler Definitions (GCL SI Manual)</title> |
| 7 |
|
| 8 |
<meta name="description" content="Compiler Definitions (GCL SI Manual)"> |
| 9 |
<meta name="keywords" content="Compiler Definitions (GCL SI Manual)"> |
| 10 |
<meta name="resource-type" content="document"> |
| 11 |
<meta name="distribution" content="global"> |
| 12 |
<meta name="Generator" content="makeinfo"> |
| 13 |
<link href="index.html" rel="start" title="Top"> |
| 14 |
<link href="Function-and-Variable-Index.html" rel="index" title="Function and Variable Index"> |
| 15 |
<link href="Function-and-Variable-Index.html#SEC_Contents" rel="contents" title="Table of Contents"> |
| 16 |
<link href="index.html" rel="up" title="Top"> |
| 17 |
<link href="Function-and-Variable-Index.html" rel="next" title="Function and Variable Index"> |
| 18 |
<link href="Low-Level-X-Interface.html" rel="prev" title="Low Level X Interface"> |
| 19 |
<style type="text/css"> |
| 20 |
<!-- |
| 21 |
a.summary-letter {text-decoration: none} |
| 22 |
blockquote.indentedblock {margin-right: 0em} |
| 23 |
div.display {margin-left: 3.2em} |
| 24 |
div.example {margin-left: 3.2em} |
| 25 |
div.lisp {margin-left: 3.2em} |
| 26 |
kbd {font-style: oblique} |
| 27 |
pre.display {font-family: inherit} |
| 28 |
pre.format {font-family: inherit} |
| 29 |
pre.menu-comment {font-family: serif} |
| 30 |
pre.menu-preformatted {font-family: serif} |
| 31 |
span.nolinebreak {white-space: nowrap} |
| 32 |
span.roman {font-family: initial; font-weight: normal} |
| 33 |
span.sansserif {font-family: sans-serif; font-weight: normal} |
| 34 |
ul.no-bullet {list-style: none} |
| 35 |
--> |
| 36 |
</style> |
| 37 |
|
| 38 |
|
| 39 |
</head> |
| 40 |
|
| 41 |
<body lang="en"> |
| 42 |
<span id="Compiler-Definitions"></span><div class="header"> |
| 43 |
<p> |
| 44 |
Next: <a href="Function-and-Variable-Index.html" accesskey="n" rel="next">Function and Variable Index</a>, Previous: <a href="Miscellaneous.html" accesskey="p" rel="prev">Miscellaneous</a>, Up: <a href="index.html" accesskey="u" rel="up">Top</a> [<a href="Function-and-Variable-Index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Function-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p> |
| 45 |
</div> |
| 46 |
<hr> |
| 47 |
<span id="Compiler-Definitions-1"></span><h2 class="chapter">20 Compiler Definitions</h2> |
| 48 |
|
| 49 |
<dl> |
| 50 |
<dt id="index-EMIT_002dFN">Function: <strong>EMIT-FN</strong> <em>(turn-on)</em></dt> |
| 51 |
<dd><p>Package:COMPILER |
| 52 |
</p> |
| 53 |
<p>If TURN-ON is t, the subsequent calls to COMPILE-FILE will |
| 54 |
cause compilation of foo.lisp to emit a foo.fn as well as foo.o. |
| 55 |
The .fn file contains cross referencing information as well as |
| 56 |
information useful to the collection utilities in cmpnew/collectfn |
| 57 |
This latter file must be manually loaded to call emit-fn. |
| 58 |
</p> |
| 59 |
|
| 60 |
</dd></dl> |
| 61 |
<dl> |
| 62 |
<dt id="index-_002aCMPINCLUDE_002dSTRING_002a">Variable: <strong>*CMPINCLUDE-STRING*</strong></dt> |
| 63 |
<dd><p>Package:COMPILER |
| 64 |
If it is a string it holds the text of the cmpinclude.h file appropriate for |
| 65 |
this version. Otherwise the usual #include of *cmpinclude* will be used. To |
| 66 |
disable this feature set *cmpinclude-string* to NIL in the init-form. |
| 67 |
</p> |
| 68 |
|
| 69 |
</dd></dl> |
| 70 |
<dl> |
| 71 |
<dt id="index-EMIT_002dFN-1">Function: <strong>EMIT-FN</strong> <em>(turn-on)</em></dt> |
| 72 |
<dd><p>Package:COMPILER |
| 73 |
</p> |
| 74 |
|
| 75 |
<p>If TURN-ON is t, then subsequent calls to compile-file on a file foo.lisp |
| 76 |
cause output of a file foo.fn. This .fn file contains lisp structures |
| 77 |
describing the functions in foo.lisp. Some tools for analyzing this data base |
| 78 |
are WHO-CALLS, LIST-UNDEFINED-FUNCTIONS, LIST-UNCALLED-FUNCTIONS, and |
| 79 |
MAKE-PROCLAIMS. |
| 80 |
</p> |
| 81 |
<p>Usage: |
| 82 |
(compiler::emit-fn t) |
| 83 |
(compile-file "foo1.lisp") |
| 84 |
(compile-file "foo2.lisp") |
| 85 |
</p> |
| 86 |
<p>This would create foo1.fn and foo2.fn. These may be loaded using LOAD. Each |
| 87 |
time compile-file is called the data base is cleared. Immediately after the |
| 88 |
compilation, the data base consists of data from the compilation. Thus if you |
| 89 |
wished to find functions called but not defined in the current file, you could |
| 90 |
do (list-undefined-functions), immediately following the compilation. If you |
| 91 |
have a large system, you would load all the .fn files before using the above |
| 92 |
tools. |
| 93 |
</p> |
| 94 |
|
| 95 |
</dd></dl> |
| 96 |
<dl> |
| 97 |
<dt id="index-MAKE_002dALL_002dPROCLAIMS">Function: <strong>MAKE-ALL-PROCLAIMS</strong> <em>(&rest directories)</em></dt> |
| 98 |
<dd><p>Package:COMPILER |
| 99 |
</p> |
| 100 |
|
| 101 |
<p>For each D in DIRECTORIES all files in (directory D) are loaded. |
| 102 |
</p> |
| 103 |
<p>For example |
| 104 |
(make-all-proclaims "lsp/*.fn" "cmpnew/*.fn") |
| 105 |
would load any files in lsp/*.fn and cmpnew/*.fn. |
| 106 |
</p> |
| 107 |
<p>[See EMIT-FN for details on creation of .fn files] |
| 108 |
</p> |
| 109 |
<p>Then calculations on the newly loaded .fn files are made, to determine |
| 110 |
function proclamations. If number of values of a function cannot be |
| 111 |
determined [for example because of a final funcall, or call of a function |
| 112 |
totally unknown at this time] then return type * is assigned. |
| 113 |
</p> |
| 114 |
<p>Finally a file sys-proclaim.lisp is written out. This file contains function |
| 115 |
proclamations. |
| 116 |
</p> |
| 117 |
<p>(load "sys-proclaim.lisp") |
| 118 |
(compile-file "foo1.lisp") |
| 119 |
(compile-file "foo2.lisp") |
| 120 |
</p> |
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
</dd></dl> |
| 125 |
<dl> |
| 126 |
<dt id="index-MAKE_002dPROCLAIMS">Function: <strong>MAKE-PROCLAIMS</strong> <em>(&optional (stream *standard-output*))</em></dt> |
| 127 |
<dd><p>Package:COMPILER |
| 128 |
</p> |
| 129 |
|
| 130 |
<p>Write to STREAM the function proclaims from the current data base. Usually a |
| 131 |
number of .fn files are loaded prior to running this. See EMIT-FN for details |
| 132 |
on how to collect this. Simply use LOAD to load in .fn files. |
| 133 |
</p> |
| 134 |
|
| 135 |
</dd></dl> |
| 136 |
<dl> |
| 137 |
<dt id="index-LIST_002dUNDEFINED_002dFUNCTIONS">Function: <strong>LIST-UNDEFINED-FUNCTIONS</strong> <em>()</em></dt> |
| 138 |
<dd><p>Package:COMPILER |
| 139 |
</p> |
| 140 |
|
| 141 |
<p>Return a list of all functions called but not defined, in the current data |
| 142 |
base (see EMIT-FN). |
| 143 |
</p> |
| 144 |
<div class="example"> |
| 145 |
<pre class="example">Sample: |
| 146 |
(compiler::emit-fn t) |
| 147 |
(compile-file "foo1.lisp") |
| 148 |
(compiler::list-undefined-functions) |
| 149 |
or |
| 150 |
(mapcar 'load (directory "*.fn")) (compiler::list-undefined-functions) |
| 151 |
|
| 152 |
</pre></div> |
| 153 |
|
| 154 |
</dd></dl> |
| 155 |
<dl> |
| 156 |
<dt id="index-WHO_002dCALLS">Function: <strong>WHO-CALLS</strong> <em>(function-name)</em></dt> |
| 157 |
<dd><p>Package:COMPILER |
| 158 |
</p> |
| 159 |
|
| 160 |
<p>List all functions in the data base [see emit-fn] which call FUNCTION-NAME. |
| 161 |
</p> |
| 162 |
|
| 163 |
</dd></dl> |
| 164 |
<dl> |
| 165 |
<dt id="index-LIST_002dUNCALLED_002dFUNCTIONS">Function: <strong>LIST-UNCALLED-FUNCTIONS</strong> <em>()</em></dt> |
| 166 |
<dd><p>Package:COMPILER |
| 167 |
</p> |
| 168 |
|
| 169 |
<p>Examine the current data base [see emit-fn] for any functions or macros which |
| 170 |
are called but are not: fboundp, OR defined in the data base, OR having |
| 171 |
special compiler optimizer properties which would eliminate an actual call. |
| 172 |
</p> |
| 173 |
|
| 174 |
|
| 175 |
|
| 176 |
</dd></dl> |
| 177 |
<dl> |
| 178 |
<dt id="index-_002aCC_002a">Variable: <strong>*CC*</strong></dt> |
| 179 |
<dd><p>Package:COMPILER |
| 180 |
Has value a string which controls which C compiler is used by GCL. |
| 181 |
Usually this string is obtained from the machine.defs file, but |
| 182 |
may be reset by the user, to change compilers or add an include path. |
| 183 |
</p> |
| 184 |
|
| 185 |
</dd></dl> |
| 186 |
<dl> |
| 187 |
<dt id="index-_002aSPLIT_002dFILES_002a">Variable: <strong>*SPLIT-FILES*</strong></dt> |
| 188 |
<dd><p>Package:COMPILER |
| 189 |
This affects the behaviour of compile-file, and is useful for cases where |
| 190 |
the C compiler cannot handle large C files resulting from lisp compilation. |
| 191 |
This scheme should allow arbitrarily long lisp files to be compiled. |
| 192 |
</p> |
| 193 |
<p>If the value [default NIL] is a positive integer, then the source file will |
| 194 |
be compiled into several object files whose names have 0,1,2,.. prepended, |
| 195 |
and which will be loaded by the main object file. File 0 will |
| 196 |
contain compilation of top level forms thru position *split-files* in the |
| 197 |
lisp source file, and file 1 the next forms, etc. Thus a 180k file |
| 198 |
would probably result in three object files (plus the master object file |
| 199 |
of the same name) if *split-files* was set to 60000. |
| 200 |
The package information will be inserted in each file. |
| 201 |
</p> |
| 202 |
|
| 203 |
</dd></dl> |
| 204 |
<dl> |
| 205 |
<dt id="index-_002aCOMPILE_002dORDINARIES_002a">Variable: <strong>*COMPILE-ORDINARIES*</strong></dt> |
| 206 |
<dd><p>Package:COMPILER |
| 207 |
If this has a non nil value [default = nil], then all top level |
| 208 |
forms will be compiled into machine instructions. Otherwise |
| 209 |
only defun’s, defmacro’s, and top level forms beginning |
| 210 |
with (progn ’compile ...) will do so. |
| 211 |
</p> |
| 212 |
|
| 213 |
</dd></dl> |
| 214 |
|
| 215 |
<hr> |
| 216 |
<div class="header"> |
| 217 |
<p> |
| 218 |
Next: <a href="Function-and-Variable-Index.html" accesskey="n" rel="next">Function and Variable Index</a>, Previous: <a href="Miscellaneous.html" accesskey="p" rel="prev">Miscellaneous</a>, Up: <a href="index.html" accesskey="u" rel="up">Top</a> [<a href="Function-and-Variable-Index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Function-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p> |
| 219 |
</div> |
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
</body> |
| 224 |
</html> |