summaryrefslogtreecommitdiff
path: root/compiler/GHC
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-01-23 10:44:07 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-02-29 05:07:10 -0500
commit99d2de860ff82e3f626c8b3d47d355ab16d18fd1 (patch)
treec55461c80e5ef7c1eb4db403f665c3eaae56613a /compiler/GHC
parent327b29e1a05d9f1ea04465c9b23aed92473dd453 (diff)
downloadhaskell-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.hs5
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)
}}}}