Hannes Siebenhandl pushed to branch wip/fendor/no-code-output-constr at Glasgow Haskell Compiler / GHC

Commits:

2 changed files:

Changes:

  • compiler/GHC/Driver/Backend.hs
    ... ... @@ -681,15 +681,17 @@ backendSupportsBreakpoints = \case
    681 681
       Named Bytecode -> True
    
    682 682
       Named NoBackend   -> False
    
    683 683
     
    
    684
    --- | If this flag is unset, then the driver ignores the flag @-finfo-table-map@,
    
    685
    --- since the backend doesn't support generating the info table map.
    
    686
    -backendSupportsInfoTableMap :: Backend -> Bool
    
    687
    -backendSupportsInfoTableMap (Named NCG)        = True
    
    688
    -backendSupportsInfoTableMap (Named LLVM)       = False
    
    689
    -backendSupportsInfoTableMap (Named ViaC)       = True
    
    690
    -backendSupportsInfoTableMap (Named JavaScript) = False
    
    691
    -backendSupportsInfoTableMap (Named Bytecode)   = False
    
    692
    -backendSupportsInfoTableMap (Named NoBackend)  = True -- We are not generating code, so we ignore it any way
    
    684
    +-- | Return is 'IsValid' if the backend supports @-finfo-table-map@.
    
    685
    +-- If 'backendSupportsInfoTableMap' returns 'NotValid', then the driver ignores
    
    686
    +-- the flag @-finfo-table-map@, since the backend doesn't support generating
    
    687
    +-- the info table map.
    
    688
    +backendSupportsInfoTableMap :: Backend -> Validity' String
    
    689
    +backendSupportsInfoTableMap (Named NCG)        = IsValid
    
    690
    +backendSupportsInfoTableMap (Named LLVM)       = NotValid "-finfo-table-map is incompatible with -fllvm and is disabled (See #26435)"
    
    691
    +backendSupportsInfoTableMap (Named ViaC)       = IsValid
    
    692
    +backendSupportsInfoTableMap (Named JavaScript) = NotValid "-finfo-table-map is incompatible with the javascript backend"
    
    693
    +backendSupportsInfoTableMap (Named Bytecode)   = NotValid "-finfo-table-map is incompatible with -fbyte-code and is disabled"
    
    694
    +backendSupportsInfoTableMap (Named NoBackend)  = IsValid -- We are not generating code, so we ignore it any way
    
    693 695
     
    
    694 696
     -- | If this flag is set, then the driver forces the
    
    695 697
     -- optimization level to 0, issuing a warning message if
    

  • compiler/GHC/Driver/Session.hs
    ... ... @@ -3903,9 +3903,8 @@ makeDynFlagsConsistent dflags
    3903 3903
             in dflags_c
    
    3904 3904
     
    
    3905 3905
      | gopt Opt_InfoTableMap dflags
    
    3906
    - , not (backendSupportsInfoTableMap (backend dflags))
    
    3907
    -    = loop (gopt_unset dflags Opt_InfoTableMap)
    
    3908
    -           $ "-finfo-table-map is incompatible with " ++ show (backend dflags) ++ " and is disabled (See #26435)"
    
    3906
    + , NotValid msg <- backendSupportsInfoTableMap (backend dflags)
    
    3907
    +    = loop (gopt_unset dflags Opt_InfoTableMap) msg
    
    3909 3908
     
    
    3910 3909
      | otherwise = (dflags, mempty, mempty)
    
    3911 3910
         where loc = mkGeneralSrcSpan (fsLit "when making flags consistent")