X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FstgSyn%2FStgSyn.lhs;h=b97e766b94f3a6cc41dd2af6697a8033bcb0fbe6;hp=74832a24aa35728f91288d944e6a9e1ed99e9775;hb=7fc749a43b4b6b85d234fa95d4928648259584f4;hpb=61d2625ae2e6a4cdae2ffc92df828905e81c24cc diff --git a/compiler/stgSyn/StgSyn.lhs b/compiler/stgSyn/StgSyn.lhs index 74832a2..b97e766 100644 --- a/compiler/stgSyn/StgSyn.lhs +++ b/compiler/stgSyn/StgSyn.lhs @@ -9,6 +9,13 @@ form of @CoreSyntax@, the style being one that happens to be ideally suited to spineless tagless code generation. \begin{code} +{-# OPTIONS -w #-} +-- The above warning supression flag is a temporary kludge. +-- While working on this module you are encouraged to remove it and fix +-- any warnings in the module. See +-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings +-- for details + module StgSyn ( GenStgArg(..), GenStgLiveVars, @@ -67,6 +74,7 @@ import UniqSet ( isEmptyUniqSet, uniqSetToList, UniqSet ) import Unique ( Unique ) import Bitmap import StaticFlags ( opt_SccProfilingOn ) +import Module ( Module, pprModule ) \end{code} %************************************************************************ @@ -167,13 +175,16 @@ constructors, primitives, and literals. \begin{code} | StgLit Literal + -- StgConApp is vital for returning unboxed tuples + -- which can't be let-bound first | StgConApp DataCon [GenStgArg occ] -- Saturated | StgOpApp StgOp -- Primitive op or foreign call [GenStgArg occ] -- Saturated - Type -- Result type; we need to know the result type - -- so that we can assign result registers. + Type -- Result type + -- We need to know this so that we can + -- assign result registers \end{code} %************************************************************************ @@ -349,6 +360,21 @@ Finally for @scc@ expressions we introduce a new STG construct. | StgSCC CostCentre -- label of SCC expression (GenStgExpr bndr occ) -- scc expression +\end{code} + +%************************************************************************ +%* * +\subsubsection{@GenStgExpr@: @hpc@ expressions} +%* * +%************************************************************************ + +Finally for @scc@ expressions we introduce a new STG construct. + +\begin{code} + | StgTick + Module -- the module of the source of this tick + Int -- tick number + (GenStgExpr bndr occ) -- sub expression -- end of GenStgExpr \end{code} @@ -719,6 +745,10 @@ pprStgExpr (StgSCC cc expr) = sep [ hsep [ptext SLIT("_scc_"), ppr cc], pprStgExpr expr ] +pprStgExpr (StgTick m n expr) + = sep [ hsep [ptext SLIT("_tick_"), pprModule m,text (show n)], + pprStgExpr expr ] + pprStgExpr (StgCase expr lvs_whole lvs_rhss bndr srt alt_type alts) = sep [sep [ptext SLIT("case"), nest 4 (hsep [pprStgExpr expr,