From 2ce5d7e354a8b7addf4916722260e8bb991571d3 Mon Sep 17 00:00:00 2001
From: Cheng Shao <terrorjack@type.dance>
Date: Mon, 3 Jun 2024 13:58:37 +0000
Subject: [PATCH] compiler: remove unused CompilerInfo/LinkerInfo types

This patch removes CompilerInfo/LinkerInfo types from the compiler
since they aren't actually used anywhere.

(cherry picked from commit 98ad1ea5ea9f113335df591cab362d841ee7b96b)
(cherry picked from commit db957a4d26d9df2f9544da97b6bf6d9f15094a11)
---
 compiler/GHC/Driver/DynFlags.hs | 29 -----------------------------
 compiler/GHC/Driver/Session.hs  |  2 --
 2 files changed, 31 deletions(-)

diff --git a/compiler/GHC/Driver/DynFlags.hs b/compiler/GHC/Driver/DynFlags.hs
index f87ac73aae1..b0b6c83eaee 100644
--- a/compiler/GHC/Driver/DynFlags.hs
+++ b/compiler/GHC/Driver/DynFlags.hs
@@ -60,10 +60,6 @@ module GHC.Driver.DynFlags (
         versionedAppDir, versionedFilePath,
         extraGccViaCFlags, globalPackageDatabasePath,
 
-        -- * Linker/compiler information
-        LinkerInfo(..),
-        CompilerInfo(..),
-
         -- * Include specifications
         IncludeSpecs(..), addGlobalInclude, addQuoteInclude, flattenIncludes,
         addImplicitQuoteInclude,
@@ -754,31 +750,6 @@ data ParMakeCount
   -- | Use the specific semaphore @<sem>@ to control parallelism (@-jsem <sem>@ flag).
   | ParMakeSemaphore FilePath
 
--- -----------------------------------------------------------------------------
--- Linker/compiler information
-
--- LinkerInfo contains any extra options needed by the system linker.
-data LinkerInfo
-  = GnuLD    [Option]
-  | Mold     [Option]
-  | GnuGold  [Option]
-  | LlvmLLD  [Option]
-  | DarwinLD [Option]
-  | SolarisLD [Option]
-  | AixLD    [Option]
-  | UnknownLD
-  deriving Eq
-
--- CompilerInfo tells us which C compiler we're using
-data CompilerInfo
-   = GCC
-   | Clang
-   | AppleClang
-   | AppleClang51
-   | Emscripten
-   | UnknownCC
-   deriving Eq
-
 -- | The 'GhcMode' tells us whether we're doing multi-module
 -- compilation (controlled via the "GHC" API) or one-shot
 -- (single-module) compilation.  This makes a difference primarily to
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs
index 87a51166c98..9563b1f067a 100644
--- a/compiler/GHC/Driver/Session.hs
+++ b/compiler/GHC/Driver/Session.hs
@@ -213,8 +213,6 @@ module GHC.Driver.Session (
         isFmaEnabled,
 
         -- * Linker/compiler information
-        LinkerInfo(..),
-        CompilerInfo(..),
         useXLinkerRPath,
 
         -- * Include specifications
-- 
GitLab