diff options
Diffstat (limited to 'compiler/nativeGen')
-rw-r--r-- | compiler/nativeGen/AsmCodeGen.hs | 32 | ||||
-rw-r--r-- | compiler/nativeGen/CFG.hs | 7 | ||||
-rw-r--r-- | compiler/nativeGen/PIC.hs | 2 | ||||
-rw-r--r-- | compiler/nativeGen/PPC/Ppr.hs | 17 | ||||
-rw-r--r-- | compiler/nativeGen/RegAlloc/Liveness.hs | 4 | ||||
-rw-r--r-- | compiler/nativeGen/SPARC/Ppr.hs | 11 | ||||
-rw-r--r-- | compiler/nativeGen/X86/Ppr.hs | 19 |
7 files changed, 27 insertions, 65 deletions
diff --git a/compiler/nativeGen/AsmCodeGen.hs b/compiler/nativeGen/AsmCodeGen.hs index 956528bf81..07cc112ef9 100644 --- a/compiler/nativeGen/AsmCodeGen.hs +++ b/compiler/nativeGen/AsmCodeGen.hs @@ -335,7 +335,7 @@ finishNativeGen :: Instruction instr finishNativeGen dflags modLoc bufh@(BufHandle _ _ h) us ngs = do -- Write debug data and finish - let emitDw = debugLevel dflags > 0 && not (gopt Opt_SplitObjs dflags) + let emitDw = debugLevel dflags > 0 us' <- if not emitDw then return us else do (dwarf, us') <- dwarfGen dflags modLoc us (ngs_debug ngs) emitNativeCode dflags bufh dwarf @@ -406,14 +406,9 @@ cmmNativeGenStream dflags this_mod modLoc ncgImpl h us cmm_stream ngs | otherwise = [] dbgMap = debugToMap ndbgs - -- Insert split marker, generate native code - let splitObjs = gopt Opt_SplitObjs dflags - split_marker = CmmProc mapEmpty mkSplitMarkerLabel [] $ - ofBlockList (panic "split_marker_entry") [] - cmms' | splitObjs = split_marker : cmms - | otherwise = cmms + -- Generate native code (ngs',us') <- cmmNativeGens dflags this_mod modLoc ncgImpl h - dbgMap us cmms' ngs 0 + dbgMap us cmms ngs 0 -- Link native code information into debug blocks -- See Note [What is this unwinding business?] in Debug. @@ -421,23 +416,10 @@ cmmNativeGenStream dflags this_mod modLoc ncgImpl h us cmm_stream ngs dumpIfSet_dyn dflags Opt_D_dump_debug "Debug Infos" (vcat $ map ppr ldbgs) - -- Emit & clear DWARF information when generating split - -- object files, as we need it to land in the same object file - -- When using split sections, note that we do not split the debug - -- info but emit all the info at once in finishNativeGen. - (ngs'', us'') <- - if debugFlag && splitObjs - then do (dwarf, us'') <- dwarfGen dflags modLoc us ldbgs - emitNativeCode dflags h dwarf - return (ngs' { ngs_debug = [] - , ngs_dwarfFiles = emptyUFM - , ngs_labels = [] }, - us'') - else return (ngs' { ngs_debug = ngs_debug ngs' ++ ldbgs - , ngs_labels = [] }, - us') - - cmmNativeGenStream dflags this_mod modLoc ncgImpl h us'' + -- Accumulate debug information for emission in finishNativeGen. + let ngs'' = ngs' { ngs_debug = ngs_debug ngs' ++ ldbgs, ngs_labels = [] } + + cmmNativeGenStream dflags this_mod modLoc ncgImpl h us' cmm_stream' ngs'' -- | Do native code generation on all these cmms. diff --git a/compiler/nativeGen/CFG.hs b/compiler/nativeGen/CFG.hs index 820785995e..7243d6a7ed 100644 --- a/compiler/nativeGen/CFG.hs +++ b/compiler/nativeGen/CFG.hs @@ -482,12 +482,7 @@ addNodesBetween m updates = -- | Generate weights for a Cmm proc based on some simple heuristics. getCfgProc :: D.CfgWeights -> RawCmmDecl -> CFG getCfgProc _ (CmmData {}) = mapEmpty --- Sometimes GHC generates dummy procs which don't actually contain code. --- But they might contain bottoms in some fields so we check for an empty --- body first. In particular this happens with SplitObjs enabled. -getCfgProc weights (CmmProc _info _lab _live graph) - | null (toBlockList graph) = mapEmpty - | otherwise = getCfg weights graph +getCfgProc weights (CmmProc _info _lab _live graph) = getCfg weights graph getCfg :: D.CfgWeights -> CmmGraph -> CFG diff --git a/compiler/nativeGen/PIC.hs b/compiler/nativeGen/PIC.hs index 2f300c4614..d46dbe10e5 100644 --- a/compiler/nativeGen/PIC.hs +++ b/compiler/nativeGen/PIC.hs @@ -565,8 +565,6 @@ pprGotDeclaration _ _ _ -- For each processor architecture, there are two versions, one for PIC -- and one for non-PIC. -- --- Whenever you change something in this assembler output, make sure --- the splitter in driver/split/ghc-split.pl recognizes the new output pprImportedSymbol :: DynFlags -> Platform -> CLabel -> SDoc pprImportedSymbol dflags platform@(Platform { platformArch = ArchPPC, platformOS = OSDarwin }) importedLbl diff --git a/compiler/nativeGen/PPC/Ppr.hs b/compiler/nativeGen/PPC/Ppr.hs index 3d9077df19..648e71b31f 100644 --- a/compiler/nativeGen/PPC/Ppr.hs +++ b/compiler/nativeGen/PPC/Ppr.hs @@ -49,17 +49,14 @@ pprNatCmmDecl proc@(CmmProc top_info lbl _ (ListGraph blocks)) = case topInfoTable proc of Nothing -> sdocWithPlatform $ \platform -> - case blocks of - [] -> -- special case for split markers: - pprLabel lbl - blocks -> -- special case for code without info table: - pprSectionAlign (Section Text lbl) $$ - (case platformArch platform of - ArchPPC_64 ELF_V1 -> pprFunctionDescriptor lbl - ArchPPC_64 ELF_V2 -> pprFunctionPrologue lbl - _ -> pprLabel lbl) $$ -- blocks guaranteed not null, + -- special case for code without info table: + pprSectionAlign (Section Text lbl) $$ + (case platformArch platform of + ArchPPC_64 ELF_V1 -> pprFunctionDescriptor lbl + ArchPPC_64 ELF_V2 -> pprFunctionPrologue lbl + _ -> pprLabel lbl) $$ -- blocks guaranteed not null, -- so label needed - vcat (map (pprBasicBlock top_info) blocks) + vcat (map (pprBasicBlock top_info) blocks) Just (Statics info_lbl _) -> sdocWithPlatform $ \platform -> diff --git a/compiler/nativeGen/RegAlloc/Liveness.hs b/compiler/nativeGen/RegAlloc/Liveness.hs index b7f8d1c871..b7dbc51961 100644 --- a/compiler/nativeGen/RegAlloc/Liveness.hs +++ b/compiler/nativeGen/RegAlloc/Liveness.hs @@ -504,10 +504,6 @@ stripLive dflags live in CmmProc info label live (ListGraph $ map (stripLiveBlock dflags) $ first' : rest') - -- procs used for stg_split_markers don't contain any blocks, and have no first_id. - stripCmm (CmmProc (LiveInfo info [] _ _) label live []) - = CmmProc info label live (ListGraph []) - -- If the proc has blocks but we don't know what the first one was, then we're dead. stripCmm proc = pprPanic "RegAlloc.Liveness.stripLive: no first_id on proc" (ppr proc) diff --git a/compiler/nativeGen/SPARC/Ppr.hs b/compiler/nativeGen/SPARC/Ppr.hs index b4cdbda369..31994c3c14 100644 --- a/compiler/nativeGen/SPARC/Ppr.hs +++ b/compiler/nativeGen/SPARC/Ppr.hs @@ -61,13 +61,10 @@ pprNatCmmDecl (CmmData section dats) = pprNatCmmDecl proc@(CmmProc top_info lbl _ (ListGraph blocks)) = case topInfoTable proc of Nothing -> - case blocks of - [] -> -- special case for split markers: - pprLabel lbl - blocks -> -- special case for code without info table: - pprSectionAlign (Section Text lbl) $$ - pprLabel lbl $$ -- blocks guaranteed not null, so label needed - vcat (map (pprBasicBlock top_info) blocks) + -- special case for code without info table: + pprSectionAlign (Section Text lbl) $$ + pprLabel lbl $$ -- blocks guaranteed not null, so label needed + vcat (map (pprBasicBlock top_info) blocks) Just (Statics info_lbl _) -> sdocWithPlatform $ \platform -> diff --git a/compiler/nativeGen/X86/Ppr.hs b/compiler/nativeGen/X86/Ppr.hs index 141e781cc6..ca19994fb3 100644 --- a/compiler/nativeGen/X86/Ppr.hs +++ b/compiler/nativeGen/X86/Ppr.hs @@ -86,17 +86,14 @@ pprNatCmmDecl proc@(CmmProc top_info lbl _ (ListGraph blocks)) = pprProcAlignment $$ case topInfoTable proc of Nothing -> - case blocks of - [] -> -- special case for split markers: - pprLabel lbl - blocks -> -- special case for code without info table: - pprSectionAlign (Section Text lbl) $$ - pprProcAlignment $$ - pprLabel lbl $$ -- blocks guaranteed not null, so label needed - vcat (map (pprBasicBlock top_info) blocks) $$ - (if debugLevel dflags > 0 - then ppr (mkAsmTempEndLabel lbl) <> char ':' else empty) $$ - pprSizeDecl lbl + -- special case for code without info table: + pprSectionAlign (Section Text lbl) $$ + pprProcAlignment $$ + pprLabel lbl $$ -- blocks guaranteed not null, so label needed + vcat (map (pprBasicBlock top_info) blocks) $$ + (if debugLevel dflags > 0 + then ppr (mkAsmTempEndLabel lbl) <> char ':' else empty) $$ + pprSizeDecl lbl Just (Statics info_lbl _) -> sdocWithPlatform $ \platform -> |