Commit f7edc878 authored by simonmar's avatar simonmar
Browse files

[project @ 2001-08-07 11:08:36 by simonmar]

- describe NOTINLINE as a synonym for NOINLINE
- describe the general form of a pragma
- mention that case is irrelevant in the first word of a pragma
- mention that unrecognised pragmas are silently ignored
parent 4a950d42
......@@ -2533,15 +2533,28 @@ would get a monomorphic type.
</sect1>
<sect1 id="pragmas">
<title>Pragmas
</title>
<sect1 id="pragmas">
<title>Pragmas</title>
<para>
GHC supports several pragmas, or instructions to the compiler placed
in the source code. Pragmas don't affect the meaning of the program,
but they might affect the efficiency of the generated code.
</para>
<indexterm><primary>pragma</primary></indexterm>
<para>GHC supports several pragmas, or instructions to the
compiler placed in the source code. Pragmas don't normally affect
the meaning of the program, but they might affect the efficiency
of the generated code.</para>
<para>Pragmas all take the form
<literal>{-# <replaceable>word</replaceable> ... #-}</literal>
where <replaceable>word</replaceable> indicates the type of
pragma, and is followed optionally by information specific to that
type of pragma. Case is ignored in
<replaceable>word</replaceable>. The various values for
<replaceable>word</replaceable> that GHC understands are described
in the following sections; any pragma encountered with an
unrecognised <replaceable>word</replaceable> is (silently)
ignored.</para>
<sect2 id="inline-pragma">
<title>INLINE pragma
......@@ -2613,17 +2626,23 @@ For example, in GHC's own <literal>UniqueSupply</literal> monad code, we have:
<title>NOINLINE pragma
</title>
<para>
<indexterm><primary>NOINLINE pragma</primary></indexterm>
<indexterm><primary>pragma, NOINLINE</primary></indexterm>
</para>
<indexterm><primary>pragma</primary><secondary>NOINLINE</secondary></indexterm>
<indexterm><primary>NOTINLINE pragma</primary></indexterm>
<indexterm><primary>pragma</primary><secondary>NOTINLINE</secondary></indexterm>
<para>
The <literal>NOINLINE</literal> pragma does exactly what you'd expect: it stops the
named function from being inlined by the compiler. You shouldn't ever
need to do this, unless you're very cautious about code size.
The <literal>NOINLINE</literal> pragma does exactly what you'd expect:
it stops the named function from being inlined by the compiler. You
shouldn't ever need to do this, unless you're very cautious about code
size.
</para>
<para><literal>NOTINLINE</literal> is a synonym for
<literal>NOINLINE</literal> (<literal>NOTINLINE</literal> is specified
by Haskell 98 as the standard way to disable inlining, so it should be
used if you want your code to be portable).</para>
</sect2>
<sect2 id="specialize-pragma">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment