From ed1ed5c6d8a7cb934fe7b91c3e03cce4556dcc71 Mon Sep 17 00:00:00 2001
From: Rodrigo Mesquita <rodrigo.m.mesquita@gmail.com>
Date: Mon, 9 Dec 2024 10:22:41 +0000
Subject: [PATCH] Revert mapMG renaming

We had previously renamed this function for consistency, but that caused unnecessary breakage
---
 compiler/GHC.hs                   | 4 ++--
 compiler/GHC/Unit/Module/Graph.hs | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/compiler/GHC.hs b/compiler/GHC.hs
index d762d4ce5a8a..6dfbc5a1c2bf 100644
--- a/compiler/GHC.hs
+++ b/compiler/GHC.hs
@@ -74,7 +74,7 @@ module GHC (
         compileToCoreModule, compileToCoreSimplified,
 
         -- * Inspecting the module structure of the program
-        ModuleGraph, emptyMG, mgMap, mkModuleGraph, mgModSummaries,
+        ModuleGraph, emptyMG, mapMG, mkModuleGraph, mgModSummaries,
         mgLookupModule,
         ModSummary(..), ms_mod_name, ModLocation(..),
         pattern ModLocation,
@@ -874,7 +874,7 @@ setProgramDynFlags_ invalidate_needed dflags = do
 --
 invalidateModSummaryCache :: GhcMonad m => m ()
 invalidateModSummaryCache =
-  modifySession $ \h -> h { hsc_mod_graph = mgMap inval (hsc_mod_graph h) }
+  modifySession $ \h -> h { hsc_mod_graph = mapMG inval (hsc_mod_graph h) }
  where
   inval ms = ms { ms_hs_hash = fingerprint0 }
 
diff --git a/compiler/GHC/Unit/Module/Graph.hs b/compiler/GHC/Unit/Module/Graph.hs
index 6d7c8dcee0d7..66e1bc1d2e09 100644
--- a/compiler/GHC/Unit/Module/Graph.hs
+++ b/compiler/GHC/Unit/Module/Graph.hs
@@ -46,7 +46,7 @@ module GHC.Unit.Module.Graph
     -- (without changing the 'ModuleGraph' structure itself!).
     -- 'mgModSummaries' lists out all 'ModSummary's, and
     -- 'mgLookupModule' looks up a 'ModSummary' for a given module.
-   , mgMap, mgMapM
+   , mapMG, mgMapM
    , mgModSummaries
    , mgLookupModule
 
@@ -239,8 +239,8 @@ lengthMG = length . mg_mss
 
 -- | Map a function 'f' over all the 'ModSummaries'.
 -- To preserve invariants, 'f' can't change the isBoot status.
-mgMap :: (ModSummary -> ModSummary) -> ModuleGraph -> ModuleGraph
-mgMap f mg@ModuleGraph{..} = mg
+mapMG :: (ModSummary -> ModSummary) -> ModuleGraph -> ModuleGraph
+mapMG f mg@ModuleGraph{..} = mg
   { mg_mss = flip fmap mg_mss $ \case
       InstantiationNode uid iuid -> InstantiationNode uid iuid
       LinkNode uid nks -> LinkNode uid nks
-- 
GitLab