[Git][ghc/ghc][master] Fix warnings in genapply

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Fri Jun 28 11:16:01 UTC 2024



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00
Fix warnings in genapply

- - - - -


1 changed file:

- utils/genapply/Main.hs


Changes:

=====================================
utils/genapply/Main.hs
=====================================
@@ -15,9 +15,7 @@ import Text.PrettyPrint
 import Data.Word
 import Data.Bits
 import Data.List        ( intersperse, nub, sort )
-import System.Exit
 import System.Environment
-import System.IO
 import Control.Arrow ((***))
 
 {-
@@ -78,8 +76,10 @@ data TargetInfo = TargetInfo
 parseTargetInfo :: FilePath -> IO TargetInfo
 parseTargetInfo path = do
   header <- readFile path
-  let tups = [ (k, read v) | '/':'/':' ':l <- lines header, let [k, v] = words l ]
-      tups_get k = v where Just v = lookup k tups
+  let tups = [ (k, read v) | '/':'/':' ':l <- lines header, [k, v] <- [words l] ]
+      tups_get k = case lookup k tups of
+                    Nothing -> error "genapply.parseTargetInfo: Missing key"
+                    Just v  -> v
       tag_bits = tups_get "TAG_BITS"
   pure TargetInfo {
     maxRealVanillaReg = tups_get "MAX_Real_Vanilla_REG",
@@ -442,7 +442,7 @@ genMkPAP targetInfo at TargetInfo {..} macro jump live _ticker disamb
               adj_reg_locs = [ (reg, off - adj + 1) |
                                (reg,off) <- extra_reg_locs ]
               adj = case extra_reg_locs of
-                      (reg, fst_off):_ -> fst_off
+                      (_reg, fst_off):_ -> fst_off
                       [] -> error "Impossible: genapply.hs : No extra register locations"
               size = snd (last adj_reg_locs) + 1
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/50caef3e81ed2c0d9adaa28aaefffa365fcef2c5

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/50caef3e81ed2c0d9adaa28aaefffa365fcef2c5
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240628/5056b28c/attachment-0001.html>


More information about the ghc-commits mailing list