diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-08-05 13:37:18 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2015-08-05 14:25:24 +0100 |
commit | a4261549afaee56b00fbea1b4bc1a07c95e60929 (patch) | |
tree | 37623ab8542a364e0e680ccf8afd9d2f7fdd4458 /docs | |
parent | 617f6966b5aaedd3ecd3f4c0f3735253187b7ff5 (diff) | |
download | haskell-a4261549afaee56b00fbea1b4bc1a07c95e60929.tar.gz |
Warn about missed specialisations for imports
This change was provoked by Trac #10720, where a missing
INLINEABLE pragma gave very poor performance.
The change is to warn when an imported function is not specialised
in a situation where the user expects it to be.
New flags
-fwarn-missed-specialisations
-fwarn-all-missed-specialisations
Documented in user manual.
See Note [Warning about missed specialisations]
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/using.xml | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/docs/users_guide/using.xml b/docs/users_guide/using.xml index 772e8b9eaa..502f7a3401 100644 --- a/docs/users_guide/using.xml +++ b/docs/users_guide/using.xml @@ -1086,7 +1086,7 @@ test.hs:(5,4)-(6,7): <option>-fwarn-warnings-deprecations</option>, <option>-fwarn-deprecated-flags</option>, <option>-fwarn-unrecognised-pragmas</option>, - <option>-fwarn-pointless-pragmas</option>, + <option>-fwarn-missed-specialisations</option>, <option>-fwarn-duplicate-constraints</option>, <option>-fwarn-duplicate-exports</option>, <option>-fwarn-overflowed-literals</option>, @@ -1287,16 +1287,24 @@ test.hs:(5,4)-(6,7): </varlistentry> <varlistentry> - <term><option>-fwarn-pointless-pragmas</option>:</term> + <term><option>-fwarn-missed-specialisations</option>, <option>-fwarn-all-missed-specialisations</option>:</term> <listitem> - <indexterm><primary><option>-fwarn-pointless-pragmas</option></primary> - </indexterm> + <indexterm><primary><option>-fwarn-missed-specialisations</option></primary></indexterm> + <indexterm><primary><option>-fwarn-all-missed-specialisations</option></primary></indexterm> <indexterm><primary>warnings</primary></indexterm> <indexterm><primary>pragmas</primary></indexterm> - <para>Causes a warning to be emitted when GHC detects that a - module contains a pragma that has no effect.</para> - - <para>This option is on by default.</para> + <para>Emits a warning if GHC cannot specialise a function that is + imported and overloaded, usually because the function needs an + <literal>INLINEABLE</literal> pragma.. The "all" form reports all + such situations. The "non-all" form only reports when the situation + arises during specialisation of an imported function; presumably teh latter + was marked <literal>INLINEABLE</literal> so that it would specialise + but if it, in turn, calls other functions that are not specialised + you won't get the performance boost you expect.</para> + + <para><option>-fwarn-missed-specialisations</option> is on by default; + <option>-fwarn-all-missed-specialisations</option> is implied by <option>-Wall</option>. + </para> </listitem> </varlistentry> |