diff options
Diffstat (limited to 'compiler/GHC/CmmToAsm/Dwarf.hs')
-rw-r--r-- | compiler/GHC/CmmToAsm/Dwarf.hs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/compiler/GHC/CmmToAsm/Dwarf.hs b/compiler/GHC/CmmToAsm/Dwarf.hs index d81bcd4f2e..7e03549b24 100644 --- a/compiler/GHC/CmmToAsm/Dwarf.hs +++ b/compiler/GHC/CmmToAsm/Dwarf.hs @@ -176,7 +176,7 @@ parent, B. -- | Generate DWARF info for a procedure debug block procToDwarf :: NCGConfig -> DebugBlock -> DwarfInfo procToDwarf config prc - = DwarfSubprogram { dwChildren = map blockToDwarf (dblBlocks prc) + = DwarfSubprogram { dwChildren = map (blockToDwarf config) (dblBlocks prc) , dwName = case dblSourceTick prc of Just s@SourceNote{} -> sourceName s _otherwise -> show (dblLabel prc) @@ -195,14 +195,17 @@ procToDwarf config prc goodParent _ = True -- | Generate DWARF info for a block -blockToDwarf :: DebugBlock -> DwarfInfo -blockToDwarf blk - = DwarfBlock { dwChildren = concatMap tickToDwarf (dblTicks blk) - ++ map blockToDwarf (dblBlocks blk) +blockToDwarf :: NCGConfig -> DebugBlock -> DwarfInfo +blockToDwarf config blk + = DwarfBlock { dwChildren = map (blockToDwarf config) (dblBlocks blk) ++ srcNotes , dwLabel = dblCLabel blk , dwMarker = marker } where + srcNotes + | ncgDwarfSourceNotes config = concatMap tickToDwarf (dblTicks blk) + | otherwise = [] + marker | Just _ <- dblPosition blk = Just $ mkAsmTempLabel $ dblLabel blk | otherwise = Nothing -- block was optimized out |