diff options
author | Christiaan Baaij <christiaan.baaij@gmail.com> | 2021-11-15 18:09:09 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-03-25 11:35:49 -0400 |
commit | 1d673aa25205084d3973a3e9c7b7cd84a8b3171c (patch) | |
tree | 46091c83ce0c11d0f010e3a6096dbc3564de7127 /compiler/GHC/Core/Opt/Specialise.hs | |
parent | 5ff690b8474c74e9c968ef31e568c1ad0fe719a1 (diff) | |
download | haskell-1d673aa25205084d3973a3e9c7b7cd84a8b3171c.tar.gz |
Add the OPAQUE pragma
A new pragma, `OPAQUE`, that ensures that every call of a named
function annotated with an `OPAQUE` pragma remains a call of that
named function, not some name-mangled variant.
Implements GHC proposal 0415:
https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0415-opaque-pragma.rst
This commit also updates the haddock submodule to handle the newly
introduced lexer tokens corresponding to the OPAQUE pragma.
Diffstat (limited to 'compiler/GHC/Core/Opt/Specialise.hs')
-rw-r--r-- | compiler/GHC/Core/Opt/Specialise.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/GHC/Core/Opt/Specialise.hs b/compiler/GHC/Core/Opt/Specialise.hs index d80e78f685..d9cc090d3d 100644 --- a/compiler/GHC/Core/Opt/Specialise.hs +++ b/compiler/GHC/Core/Opt/Specialise.hs @@ -1431,6 +1431,11 @@ specCalls spec_imp env existing_rules calls_for_me fn rhs && not (isNeverActive (idInlineActivation fn)) -- Don't specialise NOINLINE things -- See Note [Auto-specialisation and RULES] + -- + -- Don't specialise OPAQUE things, see Note [OPAQUE pragma]. + -- Since OPAQUE things are always never-active (see + -- GHC.Parser.PostProcess.mkOpaquePragma) this guard never fires for + -- OPAQUE things. -- && not (certainlyWillInline (idUnfolding fn)) -- And it's not small -- See Note [Inline specialisations] for why we do not |