diff options
author | Ian Lynagh <igloo@earth.li> | 2011-07-15 02:26:24 +0100 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2011-07-15 02:29:34 +0100 |
commit | f07af788f1d8009034332a5c0b659486fa9b4d26 (patch) | |
tree | 767f69e46f5bd58ce2822cd815f97c91d0959ba4 /compiler/utils/Digraph.lhs | |
parent | 58cc5ed228adce6529eb1e0a849e5d9ca6175524 (diff) | |
download | haskell-f07af788f1d8009034332a5c0b659486fa9b4d26.tar.gz |
More work towards cross-compilation
There's now a variant of the Outputable class that knows what
platform we're targetting:
class PlatformOutputable a where
pprPlatform :: Platform -> a -> SDoc
pprPlatformPrec :: Platform -> Rational -> a -> SDoc
and various instances have had to be converted to use that class,
and we pass Platform around accordingly.
Diffstat (limited to 'compiler/utils/Digraph.lhs')
-rw-r--r-- | compiler/utils/Digraph.lhs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/utils/Digraph.lhs b/compiler/utils/Digraph.lhs index a341bdecbc..ec65cded94 100644 --- a/compiler/utils/Digraph.lhs +++ b/compiler/utils/Digraph.lhs @@ -164,6 +164,9 @@ flattenSCC (CyclicSCC vs) = vs instance Outputable a => Outputable (SCC a) where ppr (AcyclicSCC v) = text "NONREC" $$ (nest 3 (ppr v)) ppr (CyclicSCC vs) = text "REC" $$ (nest 3 (vcat (map ppr vs))) +instance PlatformOutputable a => PlatformOutputable (SCC a) where + pprPlatform platform (AcyclicSCC v) = text "NONREC" $$ (nest 3 (pprPlatform platform v)) + pprPlatform platform (CyclicSCC vs) = text "REC" $$ (nest 3 (vcat (map (pprPlatform platform) vs))) \end{code} %************************************************************************ |