-- ---------------------------------------------------------------------
-- Find and print local and external declarations for a list of
-- Cmm statements.
--
pprTempAndExternDecls :: [CmmBlock] -> (SDoc{-temps-}, SDoc{-externs-})
pprTempAndExternDecls stmts
  = (vcat (map pprTempDecl (uniqSetToList temps)),
     vcat (map (pprExternDecl False{-ToDo-}) (Map.keys lbls)))
  where (temps, lbls) = runTE (mapM_ te_BB stmts)
pprTempAndExternDecls :: [CmmBlock] -> (SDoc{-temps-}, SDoc{-externs-})
pprTempAndExternDecls stmts
  = (vcat (map pprTempDecl (uniqSetToList temps)),
     vcat (map (pprExternDecl False{-ToDo-}) (Map.keys lbls)))
  where (temps, lbls) = runTE (mapM_ te_BB stmts)
pprTempAndExternDecls stmts
  = (vcat (map pprTempDecl (uniqSetToList temps)),
     vcat (map (pprExternDecl False{-ToDo-}) (Map.keys lbls)))
  where (temps, lbls) = runTE (mapM_ te_BB stmts)