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