From 8e04efcfccc34e82ac41c63f0b2d0e3824880efc Mon Sep 17 00:00:00 2001
From: Alan Zimmerman <alan.zimm@gmail.com>
Date: Sun, 19 May 2024 15:34:37 +0100
Subject: [PATCH] EPA: Remove redundant code

Remove unused
  epAnnAnns function
  various cases for showAstData that no longer exist
---
 compiler/GHC/Hs/Dump.hs           | 24 ------------------------
 compiler/GHC/Parser/Annotation.hs |  4 ----
 2 files changed, 28 deletions(-)

diff --git a/compiler/GHC/Hs/Dump.hs b/compiler/GHC/Hs/Dump.hs
index 3c1cdb89e90..24e583558d5 100644
--- a/compiler/GHC/Hs/Dump.hs
+++ b/compiler/GHC/Hs/Dump.hs
@@ -59,16 +59,10 @@ showAstData bs ba a0 = blankLine $$ showAstData' a0
               `ext1Q` list
               `extQ` list_addEpAnn
               `extQ` string `extQ` fastString `extQ` srcSpan `extQ` realSrcSpan
-              `extQ` annotation
               `extQ` annotationModule
-              `extQ` annotationAddEpAnn
               `extQ` annotationGrhsAnn
-              `extQ` annotationEpAnnHsCase
               `extQ` annotationAnnList
               `extQ` annotationEpAnnImportDecl
-              `extQ` annotationAnnParen
-              `extQ` annotationTrailingAnn
-              `extQ` annotationEpaLocation
               `extQ` annotationNoEpAnns
               `extQ` addEpAnn
               `extQ` annParen
@@ -235,36 +229,18 @@ showAstData bs ba a0 = blankLine $$ showAstData' a0
 
             -- -------------------------
 
-            annotation :: EpAnn [AddEpAnn] -> SDoc
-            annotation = annotation' (text "EpAnn [AddEpAnn]")
-
             annotationModule :: EpAnn AnnsModule -> SDoc
             annotationModule = annotation' (text "EpAnn AnnsModule")
 
-            annotationAddEpAnn :: EpAnn AddEpAnn -> SDoc
-            annotationAddEpAnn = annotation' (text "EpAnn AddEpAnn")
-
             annotationGrhsAnn :: EpAnn GrhsAnn -> SDoc
             annotationGrhsAnn = annotation' (text "EpAnn GrhsAnn")
 
-            annotationEpAnnHsCase :: EpAnn EpAnnHsCase -> SDoc
-            annotationEpAnnHsCase = annotation' (text "EpAnn EpAnnHsCase")
-
             annotationAnnList :: EpAnn AnnList -> SDoc
             annotationAnnList = annotation' (text "EpAnn AnnList")
 
             annotationEpAnnImportDecl :: EpAnn EpAnnImportDecl -> SDoc
             annotationEpAnnImportDecl = annotation' (text "EpAnn EpAnnImportDecl")
 
-            annotationAnnParen :: EpAnn AnnParen -> SDoc
-            annotationAnnParen = annotation' (text "EpAnn AnnParen")
-
-            annotationTrailingAnn :: EpAnn TrailingAnn -> SDoc
-            annotationTrailingAnn = annotation' (text "EpAnn TrailingAnn")
-
-            annotationEpaLocation :: EpAnn EpaLocation -> SDoc
-            annotationEpaLocation = annotation' (text "EpAnn EpaLocation")
-
             annotationNoEpAnns :: EpAnn NoEpAnns -> SDoc
             annotationNoEpAnns = annotation' (text "EpAnn NoEpAnns")
 
diff --git a/compiler/GHC/Parser/Annotation.hs b/compiler/GHC/Parser/Annotation.hs
index 6871abc9fad..0853df4bcac 100644
--- a/compiler/GHC/Parser/Annotation.hs
+++ b/compiler/GHC/Parser/Annotation.hs
@@ -70,7 +70,6 @@ module GHC.Parser.Annotation (
 
   -- ** Querying annotations
   getLocAnn,
-  epAnnAnns,
   annParen2AddEpAnn,
   epAnnComments,
 
@@ -1139,9 +1138,6 @@ widenLocatedAn (EpAnn (EpaSpan l) a cs) as = EpAnn (spanAsAnchor l') a cs
     l' = widenSpan l as
 widenLocatedAn (EpAnn anc a cs) _as = EpAnn anc a cs
 
-epAnnAnns :: EpAnn [AddEpAnn] -> [AddEpAnn]
-epAnnAnns (EpAnn _ anns _) = anns
-
 annParen2AddEpAnn :: AnnParen -> [AddEpAnn]
 annParen2AddEpAnn (AnnParen pt o c)
   = [AddEpAnn ai o, AddEpAnn ac c]
-- 
GitLab