Hannes Siebenhandl pushed to branch wip/fendor/no-code-output-constr at Glasgow Haskell Compiler / GHC Commits: 9d7e1b49 by fendor at 2026-06-30T16:40:02+02:00 Move warning message into 'backendSupportsInfoTableMap' - - - - - 2 changed files: - compiler/GHC/Driver/Backend.hs - compiler/GHC/Driver/Session.hs Changes: ===================================== compiler/GHC/Driver/Backend.hs ===================================== @@ -681,15 +681,17 @@ backendSupportsBreakpoints = \case Named Bytecode -> True Named NoBackend -> False --- | If this flag is unset, then the driver ignores the flag @-finfo-table-map@, --- since the backend doesn't support generating the info table map. -backendSupportsInfoTableMap :: Backend -> Bool -backendSupportsInfoTableMap (Named NCG) = True -backendSupportsInfoTableMap (Named LLVM) = False -backendSupportsInfoTableMap (Named ViaC) = True -backendSupportsInfoTableMap (Named JavaScript) = False -backendSupportsInfoTableMap (Named Bytecode) = False -backendSupportsInfoTableMap (Named NoBackend) = True -- We are not generating code, so we ignore it any way +-- | Return is 'IsValid' if the backend supports @-finfo-table-map@. +-- If 'backendSupportsInfoTableMap' returns 'NotValid', then the driver ignores +-- the flag @-finfo-table-map@, since the backend doesn't support generating +-- the info table map. +backendSupportsInfoTableMap :: Backend -> Validity' String +backendSupportsInfoTableMap (Named NCG) = IsValid +backendSupportsInfoTableMap (Named LLVM) = NotValid "-finfo-table-map is incompatible with -fllvm and is disabled (See #26435)" +backendSupportsInfoTableMap (Named ViaC) = IsValid +backendSupportsInfoTableMap (Named JavaScript) = NotValid "-finfo-table-map is incompatible with the javascript backend" +backendSupportsInfoTableMap (Named Bytecode) = NotValid "-finfo-table-map is incompatible with -fbyte-code and is disabled" +backendSupportsInfoTableMap (Named NoBackend) = IsValid -- We are not generating code, so we ignore it any way -- | If this flag is set, then the driver forces the -- optimization level to 0, issuing a warning message if ===================================== compiler/GHC/Driver/Session.hs ===================================== @@ -3903,9 +3903,8 @@ makeDynFlagsConsistent dflags in dflags_c | gopt Opt_InfoTableMap dflags - , not (backendSupportsInfoTableMap (backend dflags)) - = loop (gopt_unset dflags Opt_InfoTableMap) - $ "-finfo-table-map is incompatible with " ++ show (backend dflags) ++ " and is disabled (See #26435)" + , NotValid msg <- backendSupportsInfoTableMap (backend dflags) + = loop (gopt_unset dflags Opt_InfoTableMap) msg | otherwise = (dflags, mempty, mempty) where loc = mkGeneralSrcSpan (fsLit "when making flags consistent") View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9d7e1b499640277abc191868e64c9f99... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9d7e1b499640277abc191868e64c9f99... You're receiving this email because of your account on gitlab.haskell.org.