--
-- top level procs
--
pprTop :: RawCmmDecl -> SDoc
pprTop (CmmProc infos clbl _ graph) =

    (case mapLookup (g_entry graph) infos of
       Nothing -> empty
       Just (Statics info_clbl info_dat) -> pprDataExterns info_dat $$
                                            pprWordArray info_clbl info_dat) $$
    (vcat [
           blankLine,
           extern_decls,
           (if (externallyVisibleCLabel clbl)
                    then mkFN_ else mkIF_) (ppr clbl) <+> lbrace,
           nest 8 temp_decls,
           vcat (map pprBBlock blocks),
           rbrace ]
    )
  where
        blocks = toBlockListEntryFirst graph
        (temp_decls, extern_decls) = pprTempAndExternDecls blocks


-- Chunks of static data.

-- We only handle (a) arrays of word-sized things and (b) strings.
pprTop :: RawCmmDecl -> SDoc
pprTop (CmmProc infos clbl _ graph) =

    (case mapLookup (g_entry graph) infos of
       Nothing -> empty
       Just (Statics info_clbl info_dat) -> pprDataExterns info_dat $$
                                            pprWordArray info_clbl info_dat) $$
    (vcat [
           blankLine,
           extern_decls,
           (if (externallyVisibleCLabel clbl)
                    then mkFN_ else mkIF_) (ppr clbl) <+> lbrace,
           nest 8 temp_decls,
           vcat (map pprBBlock blocks),
           rbrace ]
    )
  where
        blocks = toBlockListEntryFirst graph
        (temp_decls, extern_decls) = pprTempAndExternDecls blocks


-- Chunks of static data.

-- We only handle (a) arrays of word-sized things and (b) strings.
pprTop (CmmProc infos clbl _ graph) =

    (case mapLookup (g_entry graph) infos of
       Nothing -> empty
       Just (Statics info_clbl info_dat) -> pprDataExterns info_dat $$
                                            pprWordArray info_clbl info_dat) $$
    (vcat [
           blankLine,
           extern_decls,
           (if (externallyVisibleCLabel clbl)
                    then mkFN_ else mkIF_) (ppr clbl) <+> lbrace,
           nest 8 temp_decls,
           vcat (map pprBBlock blocks),
           rbrace ]
    )
  where
        blocks = toBlockListEntryFirst graph
        (temp_decls, extern_decls) = pprTempAndExternDecls blocks


-- Chunks of static data.

-- We only handle (a) arrays of word-sized things and (b) strings.