[commit: ghc] wip/T11295-part1: readability tweaks (297b68e)

git at git.haskell.org git at git.haskell.org
Wed May 16 20:58:18 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/T11295-part1
Link       : http://ghc.haskell.org/trac/ghc/changeset/297b68ec8994589e1e49c4b83e2ca50b1692bdf4/ghc

>---------------------------------------------------------------

commit 297b68ec8994589e1e49c4b83e2ca50b1692bdf4
Author: Kavon Farvardin <kavon at farvard.in>
Date:   Wed May 16 15:44:23 2018 -0500

    readability tweaks


>---------------------------------------------------------------

297b68ec8994589e1e49c4b83e2ca50b1692bdf4
 compiler/main/DriverPipeline.hs | 2 +-
 compiler/main/SysTools.hs       | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 74aef51..5ea83ce 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1474,7 +1474,7 @@ runPhase (RealPhase LlvmOpt) input_fn dflags
   where
         -- we always (unless -optlo specified) run Opt since we rely on it to
         -- fix up some pretty big deficiencies in the code we generate
-        optIdx = min 2 $ max 0 $ optLevel dflags  -- ensure we're in [0,2]
+        optIdx = max 0 $ min 2 $ optLevel dflags  -- ensure we're in [0,2]
         llvmOpts = case lookup optIdx $ llvmPasses dflags of
                     Just passes -> passes
                     Nothing -> panic ("runPhase LlvmOpt: llvm-passes file "
diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs
index 8d7d1ea..2e52ef9 100644
--- a/compiler/main/SysTools.hs
+++ b/compiler/main/SysTools.hs
@@ -114,16 +114,16 @@ initLlvmConfig :: Maybe String
                 -> IO LlvmConfig
 initLlvmConfig mbMinusB
   = do
-      tgts <- readAndParse "llvm-targets" mkLlvmTarget
+      targets <- readAndParse "llvm-targets" mkLlvmTarget
       passes <- readAndParse "llvm-passes" id
-      return (tgts, passes)
+      return (targets, passes)
   where
-    readAndParse name bldr =
+    readAndParse name builder =
       do top_dir <- findTopDir mbMinusB
          let llvmConfigFile = top_dir </> name
          llvmConfigStr <- readFile llvmConfigFile
          case maybeReadFuzzy llvmConfigStr of
-           Just s -> return (fmap bldr <$> s)
+           Just s -> return (fmap builder <$> s)
            Nothing -> pgmError ("Can't parse " ++ show llvmConfigFile)
 
     mkLlvmTarget :: (String, String, String) -> LlvmTarget



More information about the ghc-commits mailing list