diff options
author | Peter Wortmann <scpmw@leeds.ac.uk> | 2014-12-18 21:11:23 +0100 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2014-12-18 20:54:37 -0600 |
commit | f85db7567210bc2ff7036064a26d6ba29998f025 (patch) | |
tree | a83b26055b1958c10cfc5c94e92799593c02822e /compiler/cmm/CmmNode.hs | |
parent | 4c02b6f5dc4385369aa62160acd6037a32922f84 (diff) | |
download | haskell-f85db7567210bc2ff7036064a26d6ba29998f025.tar.gz |
Some Dwarf generation fixes
- Make abbrev offset absolute on Non-Mac systems
- Add another termination byte at the end of the abbrev section
(readelf complains)
- Scope combination was wrong for the simpler cases
- Shouldn't have a "global/" in front of all scopes
Diffstat (limited to 'compiler/cmm/CmmNode.hs')
-rw-r--r-- | compiler/cmm/CmmNode.hs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/compiler/cmm/CmmNode.hs b/compiler/cmm/CmmNode.hs index b405360e87..0f26d377b1 100644 --- a/compiler/cmm/CmmNode.hs +++ b/compiler/cmm/CmmNode.hs @@ -660,6 +660,8 @@ instance Ord CmmTickScope where instance Outputable CmmTickScope where ppr GlobalScope = text "global" + ppr (SubScope us GlobalScope) + = ppr us ppr (SubScope us s) = ppr s <> char '/' <> ppr us ppr combined = parens $ hcat $ punctuate (char '+') $ map (hcat . punctuate (char '/') . map ppr . reverse) $ @@ -675,10 +677,11 @@ isTickSubScope = cmp cmp s (CombinedScope s1' s2') = cmp s s1' || cmp s s2' cmp (SubScope u s) s'@(SubScope u' _) = u == u' || cmp s s' --- | Combine two tick scopes. This smart constructor will catch cases --- where one tick scope is a sub-scope of the other already. +-- | Combine two tick scopes. The new scope should be sub-scope of +-- both parameters. We simplfy automatically if one tick scope is a +-- sub-scope of the other already. combineTickScopes :: CmmTickScope -> CmmTickScope -> CmmTickScope combineTickScopes s1 s2 - | s1 `isTickSubScope` s2 = s2 - | s2 `isTickSubScope` s1 = s1 + | s1 `isTickSubScope` s2 = s1 + | s2 `isTickSubScope` s1 = s2 | otherwise = CombinedScope s1 s2 |