diff options
Diffstat (limited to 'compiler/nativeGen/AsmCodeGen.hs')
-rw-r--r-- | compiler/nativeGen/AsmCodeGen.hs | 32 |
1 files changed, 7 insertions, 25 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. |