diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-01-23 10:44:07 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-02-29 05:07:10 -0500 |
commit | 99d2de860ff82e3f626c8b3d47d355ab16d18fd1 (patch) | |
tree | c55461c80e5ef7c1eb4db403f665c3eaae56613a /compiler/GHC | |
parent | 327b29e1a05d9f1ea04465c9b23aed92473dd453 (diff) | |
download | haskell-99d2de860ff82e3f626c8b3d47d355ab16d18fd1.tar.gz |
plugins: Ensure that loadInterface plugins can see annotations
loadInterface replaces the `mi_decls`, `mi_insts`, `mi_fam_insts`,
`mi_rules`, `mi_anns` fields of ModIface with `undefined` before
inserting the interface into the EPS. However, we still want to give
loadInterface plugins access to these fields. Consequently, we want to
pass the unmodified `ModIface` the plugin.
Diffstat (limited to 'compiler/GHC')
-rw-r--r-- | compiler/GHC/Iface/Load.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/GHC/Iface/Load.hs b/compiler/GHC/Iface/Load.hs index c812968b0a..64b25bee75 100644 --- a/compiler/GHC/Iface/Load.hs +++ b/compiler/GHC/Iface/Load.hs @@ -525,8 +525,9 @@ loadInterface doc_str mod from (length new_eps_insts) (length new_eps_rules) } - ; -- invoke plugins - res <- withPlugins dflags interfaceLoadAction final_iface + ; -- invoke plugins with *full* interface, not final_iface, to ensure + -- that plugins have access to declarations, etc. + res <- withPlugins dflags interfaceLoadAction iface ; return (Succeeded res) }}}} |