[Git][ghc/ghc][master] Remove cGhcEnableTablesNextToCode

Marge Bot gitlab at gitlab.haskell.org
Mon May 6 19:05:33 UTC 2019



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


Commits:
27941064 by John Ericson at 2019-05-06T18:59:29Z
Remove cGhcEnableTablesNextToCode

Get "Tables next to code" from the settings file instead.

- - - - -


5 changed files:

- compiler/ghc.mk
- compiler/main/DynFlags.hs
- compiler/main/SysTools.hs
- hadrian/src/Rules/Generate.hs
- includes/ghc.mk


Changes:

=====================================
compiler/ghc.mk
=====================================
@@ -106,8 +106,6 @@ ifeq "$(GhcRtsWithLibdw)" "YES"
 else
 	@echo 'cGhcRtsWithLibdw      = False'                               >> $@
 endif
-	@echo 'cGhcEnableTablesNextToCode :: String'                        >> $@
-	@echo 'cGhcEnableTablesNextToCode = "$(GhcEnableTablesNextToCode)"' >> $@
 	@echo 'cLeadingUnderscore    :: String'                             >> $@
 	@echo 'cLeadingUnderscore    = "$(LeadingUnderscore)"'              >> $@
 	@echo 'cLibFFI               :: Bool'                               >> $@


=====================================
compiler/main/DynFlags.hs
=====================================
@@ -1353,7 +1353,10 @@ data Settings = Settings {
   sOpt_lcc               :: [String], -- LLVM: c compiler
   sOpt_i                 :: [String], -- iserv options
 
-  sPlatformConstants     :: PlatformConstants
+  sPlatformConstants     :: PlatformConstants,
+
+  -- Formerly Config.hs, target specific
+  sTablesNextToCode :: Bool
  }
 
 targetPlatform :: DynFlags -> Platform
@@ -1621,17 +1624,14 @@ defaultObjectTarget platform
   | cGhcWithNativeCodeGen == "YES"      =  HscAsm
   | otherwise                           =  HscLlvm
 
-tablesNextToCode :: DynFlags -> Bool
-tablesNextToCode dflags
-    = mkTablesNextToCode (platformUnregisterised (targetPlatform dflags))
-
 -- Determines whether we will be compiling
 -- info tables that reside just before the entry code, or with an
 -- indirection to the entry code.  See TABLES_NEXT_TO_CODE in
 -- includes/rts/storage/InfoTables.h.
-mkTablesNextToCode :: Bool -> Bool
-mkTablesNextToCode unregisterised
-    = not unregisterised && cGhcEnableTablesNextToCode == "YES"
+tablesNextToCode :: DynFlags -> Bool
+tablesNextToCode dflags =
+    not (platformUnregisterised $ targetPlatform dflags) &&
+    sTablesNextToCode (settings dflags)
 
 data DynLibLoader
   = Deployable
@@ -5621,7 +5621,7 @@ compilerInfo dflags
        ("Object splitting supported",  showBool False),
        ("Have native code generator",  cGhcWithNativeCodeGen),
        ("Support SMP",                 cGhcWithSMP),
-       ("Tables next to code",         cGhcEnableTablesNextToCode),
+       ("Tables next to code",         showBool $ sTablesNextToCode $ settings dflags),
        ("RTS ways",                    cGhcRTSWays),
        ("RTS expects libdw",           showBool cGhcRtsWithLibdw),
        -- Whether or not we support @-dynamic-too@


=====================================
compiler/main/SysTools.hs
=====================================
@@ -184,6 +184,7 @@ initSysTools top_dir
        targetHasGnuNonexecStack <- readSetting "target has GNU nonexec stack"
        targetHasIdentDirective <- readSetting "target has .ident directive"
        targetHasSubsectionsViaSymbols <- readSetting "target has subsections via symbols"
+       tablesNextToCode <- getBooleanSetting "Tables next to code"
        myExtraGccViaCFlags <- getSetting "GCC extra via C opts"
        -- On Windows, mingw is distributed with GHC,
        -- so we look in TopDir/../mingw/bin,
@@ -303,7 +304,8 @@ initSysTools top_dir
                     sOpt_lo      = [],
                     sOpt_lc      = [],
                     sOpt_i       = [],
-                    sPlatformConstants = platformConstants
+                    sPlatformConstants = platformConstants,
+                    sTablesNextToCode = tablesNextToCode
              }
 
 


=====================================
hadrian/src/Rules/Generate.hs
=====================================
@@ -303,6 +303,8 @@ generateSettings = do
         , ("LLVM llc command", settingsFileSetting SettingsFileSetting_LlcCommand)
         , ("LLVM opt command", settingsFileSetting SettingsFileSetting_OptCommand)
         , ("LLVM clang command", settingsFileSetting SettingsFileSetting_ClangCommand)
+
+        , ("Tables next to code", yesNo <$> ghcEnableTablesNextToCode)
         ]
     let showTuple (k, v) = "(" ++ show k ++ ", " ++ show v ++ ")"
     pure $ case settings of
@@ -334,7 +336,6 @@ generateConfigHs = do
     cGhcWithInterpreter        <- expr $ yesNo <$> ghcWithInterpreter
     cGhcWithNativeCodeGen      <- expr $ yesNo <$> ghcWithNativeCodeGen
     cGhcWithSMP                <- expr $ yesNo <$> ghcWithSMP
-    cGhcEnableTablesNextToCode <- expr $ yesNo <$> ghcEnableTablesNextToCode
     cLeadingUnderscore         <- expr $ yesNo <$> flag LeadingUnderscore
     cLibFFI                    <- expr useLibFFIForAdjustors
     rtsWays                    <- getRtsWays
@@ -389,8 +390,6 @@ generateConfigHs = do
         , "cGhcWithSMP           = " ++ show cGhcWithSMP
         , "cGhcRTSWays           :: String"
         , "cGhcRTSWays           = " ++ show cGhcRTSWays
-        , "cGhcEnableTablesNextToCode :: String"
-        , "cGhcEnableTablesNextToCode = " ++ show cGhcEnableTablesNextToCode
         , "cLeadingUnderscore    :: String"
         , "cLeadingUnderscore    = " ++ show cLeadingUnderscore
         , "cLibFFI               :: Bool"


=====================================
includes/ghc.mk
=====================================
@@ -210,6 +210,7 @@ $(includes_SETTINGS) : includes/Makefile | $$(dir $$@)/.
 	@echo ',("LLVM llc command", "$(SettingsLlcCommand)")' >> $@
 	@echo ',("LLVM opt command", "$(SettingsOptCommand)")' >> $@
 	@echo ',("LLVM clang command", "$(SettingsClangCommand)")' >> $@
+	@echo ',("Tables next to code", "$(GhcEnableTablesNextToCode)")' >> $@
 	@echo ']' >> $@
 
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/27941064872b19f65e99ba65b7fa8635268ee738

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/27941064872b19f65e99ba65b7fa8635268ee738
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/20190506/aba7441d/attachment-0001.html>


More information about the ghc-commits mailing list