diff options
author | alexbiehl <alex.biehl@gmail.com> | 2017-10-08 19:38:21 +0200 |
---|---|---|
committer | alexbiehl <alex.biehl@gmail.com> | 2017-10-08 19:38:21 +0200 |
commit | 671b62d104751fd0ab8daf6b9cda1b971abf331f (patch) | |
tree | 43e1605c5e49ce0cf6d060fffb838f23e0e136aa /haddock-api/src/Haddock/Interface.hs | |
parent | 406030f2782590799e44470da7ca80e85f3cf026 (diff) | |
parent | e498b7871bfbee8b38858b546390246ddddb9509 (diff) |
Merge remote-tracking branch 'origin/ghc-head' into HEAD
Diffstat (limited to 'haddock-api/src/Haddock/Interface.hs')
-rw-r--r-- | haddock-api/src/Haddock/Interface.hs | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/haddock-api/src/Haddock/Interface.hs b/haddock-api/src/Haddock/Interface.hs index 25755cff..20689a8f 100644 --- a/haddock-api/src/Haddock/Interface.hs +++ b/haddock-api/src/Haddock/Interface.hs @@ -122,11 +122,7 @@ createIfaces0 verbosity modules flags instIfaceMap = -- resulting ModSummaries. (if useTempDir then withTempOutputDir else id) $ do modGraph <- depAnalysis - if needsTemplateHaskell modGraph then do - modGraph' <- enableCompilation modGraph - createIfaces verbosity flags instIfaceMap modGraph' - else - createIfaces verbosity flags instIfaceMap modGraph + createIfaces verbosity flags instIfaceMap modGraph where useTempDir :: Bool @@ -149,17 +145,6 @@ createIfaces0 verbosity modules flags instIfaceMap = depanal [] False - enableCompilation :: ModuleGraph -> Ghc ModuleGraph - enableCompilation modGraph = do - let enableComp d = let platform = targetPlatform d - in d { hscTarget = defaultObjectTarget platform } - modifySessionDynFlags enableComp - -- We need to update the DynFlags of the ModSummaries as well. - let upd m = m { ms_hspp_opts = enableComp (ms_hspp_opts m) } - let modGraph' = map upd modGraph - return modGraph' - - createIfaces :: Verbosity -> [Flag] -> InstIfaceMap -> ModuleGraph -> Ghc [Interface] createIfaces verbosity flags instIfaceMap mods = do let sortedMods = flattenSCCs $ topSortModuleGraph False mods Nothing @@ -194,7 +179,7 @@ processModule verbosity modsum flags modMap instIfaceMap = do , expItemMbDoc = (Documentation Nothing _, _) } <- ifaceExportItems interface ] where - formatName :: SrcSpan -> HsDecl Name -> String + formatName :: SrcSpan -> HsDecl GhcRn -> String formatName loc n = p (getMainDeclBinder n) ++ case loc of RealSrcSpan rss -> " (" ++ unpackFS (srcSpanFile rss) ++ ":" ++ show (srcSpanStartLine rss) ++ ")" _ -> "" |