summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-01-23 10:44:07 -0500
committerBen Gamari <ben@well-typed.com>2020-02-10 12:04:38 -0500
commit938fc5ce96a62065f6896f67350808daaae2b55a (patch)
tree0a235707d0eb4dcd804bc4020081a0051ecd5679
parent00dc0f7e66a18ab50931325cb6333a2bfd2a6650 (diff)
downloadhaskell-wip/T17730.tar.gz
plugins: Ensure that loadInterface plugins can see annotationswip/T17730
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.
-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 77eefc4c7b..ace8c7d977 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)
}}}}