2 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
4 \section[StgSyn]{Shared term graph (STG) syntax for spineless-tagless code generation}
6 This data type represents programs just before code generation
7 (conversion to @AbstractC@): basically, what we have is a stylised
8 form of @CoreSyntax@, the style being one that happens to be ideally
9 suited to spineless tagless code generation.
16 GenStgBinding(..), GenStgExpr(..), GenStgRhs(..),
17 GenStgCaseAlts(..), GenStgCaseDefault(..),
19 UpdateFlag(..), isUpdatable,
22 noBinderInfo, stgSatOcc, stgUnsatOcc, satCallsOnly,
25 -- a set of synonyms for the most common (only :-) parameterisation
27 StgBinding, StgExpr, StgRhs,
28 StgCaseAlts, StgCaseDefault,
34 SRT(..), noSRT, nonEmptySRT,
37 stgBindHasCafRefs, stgRhsArity, getArgPrimRep,
38 isLitLitArg, isDllConApp, isStgTypeArg,
39 stgArgType, stgBinders,
41 pprStgBinding, pprStgBindings, pprStgBindingsWithSRTs, pprStgAlts
48 #include "HsVersions.h"
50 import CostCentre ( CostCentreStack, CostCentre )
51 import VarSet ( IdSet, isEmptyVarSet )
53 import Id ( Id, idName, idPrimRep, idType )
54 import Name ( isDllName )
55 import Literal ( Literal, literalType, isLitLitLit, literalPrimRep )
56 import ForeignCall ( ForeignCall )
57 import DataCon ( DataCon, dataConName )
58 import PrimOp ( PrimOp )
62 import TyCon ( TyCon )
63 import UniqSet ( isEmptyUniqSet, uniqSetToList, UniqSet )
64 import Unique ( Unique )
65 import CmdLineOpts ( opt_SccProfilingOn )
68 %************************************************************************
70 \subsection{@GenStgBinding@}
72 %************************************************************************
74 As usual, expressions are interesting; other things are boring. Here
75 are the boring things [except note the @GenStgRhs@], parameterised
76 with respect to binder and occurrence information (just as in
79 There is one SRT for each group of bindings.
82 data GenStgBinding bndr occ
83 = StgNonRec SRT bndr (GenStgRhs bndr occ)
84 | StgRec SRT [(bndr, GenStgRhs bndr occ)]
86 stgBinders :: GenStgBinding bndr occ -> [bndr]
87 stgBinders (StgNonRec _ b _) = [b]
88 stgBinders (StgRec _ bs) = map fst bs
91 %************************************************************************
93 \subsection{@GenStgArg@}
95 %************************************************************************
101 | StgTypeArg Type -- For when we want to preserve all type info
105 getArgPrimRep (StgVarArg local) = idPrimRep local
106 getArgPrimRep (StgLitArg lit) = literalPrimRep lit
108 isLitLitArg (StgLitArg lit) = isLitLitLit lit
109 isLitLitArg _ = False
111 isStgTypeArg (StgTypeArg _) = True
112 isStgTypeArg other = False
114 isDllArg :: StgArg -> Bool
115 -- Does this argument refer to something in a different DLL?
116 isDllArg (StgTypeArg v) = False
117 isDllArg (StgVarArg v) = isDllName (idName v)
118 isDllArg (StgLitArg lit) = isLitLitLit lit
120 isDllConApp :: DataCon -> [StgArg] -> Bool
121 -- Does this constructor application refer to
122 -- anything in a different DLL?
123 -- If so, we can't allocate it statically
124 isDllConApp con args = isDllName (dataConName con) || any isDllArg args
126 stgArgType :: StgArg -> Type
127 -- Very half baked becase we have lost the type arguments
128 stgArgType (StgVarArg v) = idType v
129 stgArgType (StgLitArg lit) = literalType lit
130 stgArgType (StgTypeArg lit) = panic "stgArgType called on stgTypeArg"
133 %************************************************************************
135 \subsection{STG expressions}
137 %************************************************************************
139 The @GenStgExpr@ data type is parameterised on binder and occurrence
142 %************************************************************************
144 \subsubsection{@GenStgExpr@ application}
146 %************************************************************************
148 An application is of a function to a list of atoms [not expressions].
149 Operationally, we want to push the arguments on the stack and call the
150 function. (If the arguments were expressions, we would have to build
151 their closures first.)
153 There is no constructor for a lone variable; it would appear as
156 type GenStgLiveVars occ = UniqSet occ
158 data GenStgExpr bndr occ
161 [GenStgArg occ] -- arguments; may be empty
164 %************************************************************************
166 \subsubsection{@StgConApp@ and @StgPrimApp@---saturated applications}
168 %************************************************************************
170 There are a specialised forms of application, for
171 constructors, primitives, and literals.
176 [GenStgArg occ] -- Saturated
178 | StgOpApp StgOp -- Primitive op or foreign call
179 [GenStgArg occ] -- Saturated
180 Type -- Result type; we need to know the result type
181 -- so that we can assign result registers.
184 %************************************************************************
186 \subsubsection{@StgLam@}
188 %************************************************************************
190 StgLam is used *only* during CoreToStg's work. Before CoreToStg has finished
191 it encodes (\x -> e) as (let f = \x -> e in f)
195 Type -- Type of whole lambda (useful when making a binder for it)
197 StgExpr -- Body of lambda
201 %************************************************************************
203 \subsubsection{@GenStgExpr@: case-expressions}
205 %************************************************************************
207 This has the same boxed/unboxed business as Core case expressions.
210 (GenStgExpr bndr occ)
211 -- the thing to examine
213 (GenStgLiveVars occ) -- Live vars of whole case expression,
214 -- plus everything that happens after the case
215 -- i.e., those which mustn't be overwritten
217 (GenStgLiveVars occ) -- Live vars of RHSs (plus what happens afterwards)
218 -- i.e., those which must be saved before eval.
220 -- note that an alt's constructor's
221 -- binder-variables are NOT counted in the
222 -- free vars for the alt's RHS
224 bndr -- binds the result of evaluating the scrutinee
226 SRT -- The SRT for the continuation
228 (GenStgCaseAlts bndr occ)
231 %************************************************************************
233 \subsubsection{@GenStgExpr@: @let(rec)@-expressions}
235 %************************************************************************
237 The various forms of let(rec)-expression encode most of the
238 interesting things we want to do.
242 let-closure x = [free-vars] expr [args]
247 let x = (\free-vars -> \args -> expr) free-vars
249 \tr{args} may be empty (and is for most closures). It isn't under
250 circumstances like this:
256 let-closure x = [z] [y] (y+z)
258 The idea is that we compile code for @(y+z)@ in an environment in which
259 @z@ is bound to an offset from \tr{Node}, and @y@ is bound to an
260 offset from the stack pointer.
262 (A let-closure is an @StgLet@ with a @StgRhsClosure@ RHS.)
266 let-constructor x = Constructor [args]
270 (A let-constructor is an @StgLet@ with a @StgRhsCon@ RHS.)
273 Letrec-expressions are essentially the same deal as
274 let-closure/let-constructor, so we use a common structure and
275 distinguish between them with an @is_recursive@ boolean flag.
279 let-unboxed u = an arbitrary arithmetic expression in unboxed values
282 All the stuff on the RHS must be fully evaluated. No function calls either!
284 (We've backed away from this toward case-expressions with
285 suitably-magical alts ...)
288 ~[Advanced stuff here! Not to start with, but makes pattern matching
289 generate more efficient code.]
292 let-escapes-not fail = expr
295 Here the idea is that @e'@ guarantees not to put @fail@ in a data structure,
296 or pass it to another function. All @e'@ will ever do is tail-call @fail@.
297 Rather than build a closure for @fail@, all we need do is to record the stack
298 level at the moment of the @let-escapes-not@; then entering @fail@ is just
299 a matter of adjusting the stack pointer back down to that point and entering
304 f x y = let z = huge-expression in
310 (A let-escapes-not is an @StgLetNoEscape@.)
313 We may eventually want:
315 let-literal x = Literal
319 (ToDo: is this obsolete?)
322 And so the code for let(rec)-things:
325 (GenStgBinding bndr occ) -- right hand sides (see below)
326 (GenStgExpr bndr occ) -- body
328 | StgLetNoEscape -- remember: ``advanced stuff''
329 (GenStgLiveVars occ) -- Live in the whole let-expression
330 -- Mustn't overwrite these stack slots
331 -- *Doesn't* include binders of the let(rec).
333 (GenStgLiveVars occ) -- Live in the right hand sides (only)
334 -- These are the ones which must be saved on
335 -- the stack if they aren't there already
336 -- *Does* include binders of the let(rec) if recursive.
338 (GenStgBinding bndr occ) -- right hand sides (see below)
339 (GenStgExpr bndr occ) -- body
342 %************************************************************************
344 \subsubsection{@GenStgExpr@: @scc@ expressions}
346 %************************************************************************
348 Finally for @scc@ expressions we introduce a new STG construct.
352 CostCentre -- label of SCC expression
353 (GenStgExpr bndr occ) -- scc expression
357 %************************************************************************
359 \subsection{STG right-hand sides}
361 %************************************************************************
363 Here's the rest of the interesting stuff for @StgLet@s; the first
364 flavour is for closures:
366 data GenStgRhs bndr occ
368 CostCentreStack -- CCS to be attached (default is CurrentCCS)
369 StgBinderInfo -- Info about how this binder is used (see below)
370 [occ] -- non-global free vars; a list, rather than
371 -- a set, because order is important
372 !UpdateFlag -- ReEntrant | Updatable | SingleEntry
373 [bndr] -- arguments; if empty, then not a function;
374 -- as above, order is important.
375 (GenStgExpr bndr occ) -- body
377 An example may be in order. Consider:
379 let t = \x -> \y -> ... x ... y ... p ... q in e
381 Pulling out the free vars and stylising somewhat, we get the equivalent:
383 let t = (\[p,q] -> \[x,y] -> ... x ... y ... p ...q) p q
385 Stg-operationally, the @[x,y]@ are on the stack, the @[p,q]@ are
386 offsets from @Node@ into the closure, and the code ptr for the closure
387 will be exactly that in parentheses above.
389 The second flavour of right-hand-side is for constructors (simple but important):
392 CostCentreStack -- CCS to be attached (default is CurrentCCS).
393 -- Top-level (static) ones will end up with
394 -- DontCareCCS, because we don't count static
395 -- data in heap profiles, and we don't set CCCS
396 -- from static closure.
397 DataCon -- constructor
398 [GenStgArg occ] -- args
402 stgRhsArity :: StgRhs -> Int
403 stgRhsArity (StgRhsClosure _ _ _ _ bndrs _) = count isId bndrs
404 -- The arity never includes type parameters, so
405 -- when keeping type arguments and binders in the Stg syntax
406 -- (opt_RuntimeTypes) we have to fliter out the type binders.
407 stgRhsArity (StgRhsCon _ _ _) = 0
411 stgBindHasCafRefs :: GenStgBinding bndr occ -> Bool
412 stgBindHasCafRefs (StgNonRec srt _ rhs)
413 = nonEmptySRT srt || rhsIsUpdatable rhs
414 stgBindHasCafRefs (StgRec srt binds)
415 = nonEmptySRT srt || any rhsIsUpdatable (map snd binds)
417 rhsIsUpdatable (StgRhsClosure _ _ _ upd _ _) = isUpdatable upd
418 rhsIsUpdatable _ = False
421 Here's the @StgBinderInfo@ type, and its combining op:
425 | SatCallsOnly -- All occurrences are *saturated* *function* calls
426 -- This means we don't need to build an info table and
427 -- slow entry code for the thing
428 -- Thunks never get this value
430 noBinderInfo = NoStgBinderInfo
431 stgUnsatOcc = NoStgBinderInfo
432 stgSatOcc = SatCallsOnly
434 satCallsOnly :: StgBinderInfo -> Bool
435 satCallsOnly SatCallsOnly = True
436 satCallsOnly NoStgBinderInfo = False
438 combineStgBinderInfo :: StgBinderInfo -> StgBinderInfo -> StgBinderInfo
439 combineStgBinderInfo SatCallsOnly SatCallsOnly = SatCallsOnly
440 combineStgBinderInfo info1 info2 = NoStgBinderInfo
443 pp_binder_info NoStgBinderInfo = empty
444 pp_binder_info SatCallsOnly = ptext SLIT("sat-only")
447 %************************************************************************
449 \subsection[Stg-case-alternatives]{STG case alternatives}
451 %************************************************************************
453 Just like in @CoreSyntax@ (except no type-world stuff).
455 * Algebraic cases are done using
456 StgAlgAlts (Just tc) alts deflt
458 * Polymorphic cases, or case of a function type, are done using
459 StgAlgAlts Nothing [] (StgBindDefault e)
461 * Primitive cases are done using
462 StgPrimAlts tc alts deflt
464 We thought of giving polymorphic cases their own constructor,
465 but we get a bit more code sharing this way
467 The type constructor in StgAlgAlts/StgPrimAlts is guaranteed not
468 to be abstract; that is, we can see its representation. This is
469 important because the code generator uses it to determine return
470 conventions etc. But it's not trivial where there's a moduule loop
471 involved, because some versions of a type constructor might not have
472 all the constructors visible. So mkStgAlgAlts (in CoreToStg) ensures
473 that it gets the TyCon from the constructors or literals (which are
474 guaranteed to have the Real McCoy) rather than from the scrutinee type.
477 data GenStgCaseAlts bndr occ
478 = StgAlgAlts (Maybe TyCon) -- Just tc => scrutinee type is
479 -- an algebraic data type
480 -- Nothing => scrutinee type is a type
481 -- variable or function type
482 [(DataCon, -- alts: data constructor,
483 [bndr], -- constructor's parameters,
484 [Bool], -- "use mask", same length as
485 -- parameters; a True in a
486 -- param's position if it is
488 GenStgExpr bndr occ)] -- ...right-hand side.
489 (GenStgCaseDefault bndr occ)
492 [(Literal, -- alts: unboxed literal,
493 GenStgExpr bndr occ)] -- rhs.
494 (GenStgCaseDefault bndr occ)
496 data GenStgCaseDefault bndr occ
497 = StgNoDefault -- small con family: all
498 -- constructor accounted for
499 | StgBindDefault (GenStgExpr bndr occ)
502 %************************************************************************
504 \subsection[Stg]{The Plain STG parameterisation}
506 %************************************************************************
508 This happens to be the only one we use at the moment.
511 type StgBinding = GenStgBinding Id Id
512 type StgArg = GenStgArg Id
513 type StgLiveVars = GenStgLiveVars Id
514 type StgExpr = GenStgExpr Id Id
515 type StgRhs = GenStgRhs Id Id
516 type StgCaseAlts = GenStgCaseAlts Id Id
517 type StgCaseDefault = GenStgCaseDefault Id Id
520 %************************************************************************
522 \subsubsection[UpdateFlag-datatype]{@UpdateFlag@}
524 %************************************************************************
526 This is also used in @LambdaFormInfo@ in the @ClosureInfo@ module.
528 A @ReEntrant@ closure may be entered multiple times, but should not be
529 updated or blackholed. An @Updatable@ closure should be updated after
530 evaluation (and may be blackholed during evaluation). A @SingleEntry@
531 closure will only be entered once, and so need not be updated but may
532 safely be blackholed.
535 data UpdateFlag = ReEntrant | Updatable | SingleEntry
537 instance Outputable UpdateFlag where
539 = char (case u of { ReEntrant -> 'r'; Updatable -> 'u'; SingleEntry -> 's' })
541 isUpdatable ReEntrant = False
542 isUpdatable SingleEntry = False
543 isUpdatable Updatable = True
546 %************************************************************************
548 \subsubsection{StgOp}
550 %************************************************************************
552 An StgOp allows us to group together PrimOps and ForeignCalls.
553 It's quite useful to move these around together, notably
554 in StgOpApp and COpStmt.
557 data StgOp = StgPrimOp PrimOp
559 | StgFCallOp ForeignCall Unique
560 -- The Unique is occasionally needed by the C pretty-printer
561 -- (which lacks a unique supply), notably when generating a
562 -- typedef for foreign-export-dynamic
566 %************************************************************************
568 \subsubsection[Static Reference Tables]{@SRT@}
570 %************************************************************************
572 There is one SRT per top-level function group. Each local binding and
573 case expression within this binding group has a subrange of the whole
574 SRT, expressed as an offset and length.
576 In CoreToStg we collect the list of CafRefs at each SRT site, which is later
577 converted into the length and offset form by the SRT pass.
581 | SRTEntries IdSet -- generated by CoreToStg
582 | SRT !Int{-offset-} !Int{-length-} -- generated by computeSRTs
587 nonEmptySRT NoSRT = False
588 nonEmptySRT (SRTEntries vs) = not (isEmptyVarSet vs)
591 pprSRT (NoSRT) = ptext SLIT("_no_srt_")
592 pprSRT (SRTEntries ids) = text "SRT:" <> ppr ids
593 pprSRT (SRT off len) = parens (ppr off <> comma <> ppr len)
596 %************************************************************************
598 \subsection[Stg-pretty-printing]{Pretty-printing}
600 %************************************************************************
602 Robin Popplestone asked for semi-colon separators on STG binds; here's
603 hoping he likes terminators instead... Ditto for case alternatives.
606 pprGenStgBinding :: (Outputable bndr, Outputable bdee, Ord bdee)
607 => GenStgBinding bndr bdee -> SDoc
609 pprGenStgBinding (StgNonRec srt bndr rhs)
610 = pprMaybeSRT srt $$ hang (hsep [ppr bndr, equals])
611 4 ((<>) (ppr rhs) semi)
613 pprGenStgBinding (StgRec srt pairs)
614 = vcat ((ifPprDebug (ptext SLIT("{- StgRec (begin) -}"))) :
616 (map (ppr_bind) pairs) ++ [(ifPprDebug (ptext SLIT("{- StgRec (end) -}")))])
618 ppr_bind (bndr, expr)
619 = hang (hsep [ppr bndr, equals])
620 4 ((<>) (ppr expr) semi)
622 pprStgBinding :: StgBinding -> SDoc
623 pprStgBinding bind = pprGenStgBinding bind
625 pprStgBindings :: [StgBinding] -> SDoc
626 pprStgBindings binds = vcat (map pprGenStgBinding binds)
628 pprGenStgBindingWithSRT
629 :: (Outputable bndr, Outputable bdee, Ord bdee)
630 => (GenStgBinding bndr bdee,[Id]) -> SDoc
632 pprGenStgBindingWithSRT (bind,srt)
633 = vcat [ pprGenStgBinding bind,
634 ptext SLIT("SRT: ") <> ppr srt ]
636 pprStgBindingsWithSRTs :: [(StgBinding,[Id])] -> SDoc
637 pprStgBindingsWithSRTs binds = vcat (map pprGenStgBindingWithSRT binds)
641 instance (Outputable bdee) => Outputable (GenStgArg bdee) where
644 instance (Outputable bndr, Outputable bdee, Ord bdee)
645 => Outputable (GenStgBinding bndr bdee) where
646 ppr = pprGenStgBinding
648 instance (Outputable bndr, Outputable bdee, Ord bdee)
649 => Outputable (GenStgExpr bndr bdee) where
652 instance (Outputable bndr, Outputable bdee, Ord bdee)
653 => Outputable (GenStgRhs bndr bdee) where
654 ppr rhs = pprStgRhs rhs
658 pprStgArg :: (Outputable bdee) => GenStgArg bdee -> SDoc
660 pprStgArg (StgVarArg var) = ppr var
661 pprStgArg (StgLitArg con) = ppr con
662 pprStgArg (StgTypeArg ty) = char '@' <+> ppr ty
666 pprStgExpr :: (Outputable bndr, Outputable bdee, Ord bdee)
667 => GenStgExpr bndr bdee -> SDoc
669 pprStgExpr (StgLit lit) = ppr lit
672 pprStgExpr (StgApp func args)
674 4 (sep (map (ppr) args))
678 pprStgExpr (StgConApp con args)
679 = hsep [ ppr con, brackets (interppSP args)]
681 pprStgExpr (StgOpApp op args _)
682 = hsep [ pprStgOp op, brackets (interppSP args)]
684 pprStgExpr (StgLam _ bndrs body)
685 =sep [ char '\\' <+> ppr bndrs <+> ptext SLIT("->"),
690 -- special case: let v = <very specific thing>
696 -- Very special! Suspicious! (SLPJ)
699 pprStgExpr (StgLet srt (StgNonRec bndr (StgRhsClosure cc bi free_vars upd_flag args rhs))
702 (hang (hcat [ptext SLIT("let { "), ppr bndr, ptext SLIT(" = "),
705 ptext SLIT(" ["), ifPprDebug (interppSP free_vars), ptext SLIT("] \\"),
706 ppr upd_flag, ptext SLIT(" ["),
707 interppSP args, char ']'])
708 8 (sep [hsep [ppr rhs, ptext SLIT("} in")]]))
712 -- special case: let ... in let ...
714 pprStgExpr (StgLet bind expr@(StgLet _ _))
716 (sep [hang (ptext SLIT("let {"))
717 2 (hsep [pprGenStgBinding bind, ptext SLIT("} in")])])
721 pprStgExpr (StgLet bind expr)
722 = sep [hang (ptext SLIT("let {")) 2 (pprGenStgBinding bind),
723 hang (ptext SLIT("} in ")) 2 (ppr expr)]
725 pprStgExpr (StgLetNoEscape lvs_whole lvs_rhss bind expr)
726 = sep [hang (ptext SLIT("let-no-escape {"))
727 2 (pprGenStgBinding bind),
728 hang ((<>) (ptext SLIT("} in "))
731 hcat [ptext SLIT("-- lvs: ["), interppSP (uniqSetToList lvs_whole),
732 ptext SLIT("]; rhs lvs: ["), interppSP (uniqSetToList lvs_rhss),
738 pprStgExpr (StgSCC cc expr)
739 = sep [ hsep [ptext SLIT("_scc_"), ppr cc],
744 pprStgExpr (StgCase expr lvs_whole lvs_rhss bndr srt alts)
745 = sep [sep [ptext SLIT("case"),
746 nest 4 (hsep [pprStgExpr expr,
747 ifPprDebug (dcolon <+> pp_ty alts)]),
748 ptext SLIT("of"), ppr bndr, char '{'],
751 hcat [ptext SLIT("-- lvs: ["), interppSP (uniqSetToList lvs_whole),
752 ptext SLIT("]; rhs lvs: ["), interppSP (uniqSetToList lvs_rhss),
755 nest 2 (pprStgAlts alts),
758 pp_ty (StgAlgAlts maybe_tycon _ _) = ppr maybe_tycon
759 pp_ty (StgPrimAlts tycon _ _) = ppr tycon
761 pprStgAlts (StgAlgAlts _ alts deflt)
762 = vcat [ vcat (map (ppr_bxd_alt) alts),
763 pprStgDefault deflt ]
765 ppr_bxd_alt (con, params, use_mask, expr)
766 = hang (hsep [ppr con, interppSP params, ptext SLIT("->")])
767 4 ((<>) (ppr expr) semi)
769 pprStgAlts (StgPrimAlts _ alts deflt)
770 = vcat [ vcat (map (ppr_ubxd_alt) alts),
771 pprStgDefault deflt ]
773 ppr_ubxd_alt (lit, expr)
774 = hang (hsep [ppr lit, ptext SLIT("->")])
775 4 ((<>) (ppr expr) semi)
777 pprStgDefault StgNoDefault = empty
778 pprStgDefault (StgBindDefault expr) = hang (hsep [ptext SLIT("DEFAULT"), ptext SLIT("->")])
781 pprStgOp (StgPrimOp op) = ppr op
782 pprStgOp (StgFCallOp op _) = ppr op
786 pprStgLVs :: Outputable occ => GenStgLiveVars occ -> SDoc
788 = getPprStyle $ \ sty ->
789 if userStyle sty || isEmptyUniqSet lvs then
792 hcat [text "{-lvs:", interpp'SP (uniqSetToList lvs), text "-}"]
796 pprStgRhs :: (Outputable bndr, Outputable bdee, Ord bdee)
797 => GenStgRhs bndr bdee -> SDoc
800 pprStgRhs (StgRhsClosure cc bi [free_var] upd_flag [{-no args-}] (StgApp func []))
803 brackets (ifPprDebug (ppr free_var)),
804 ptext SLIT(" \\"), ppr upd_flag, ptext SLIT(" [] "), ppr func ]
807 pprStgRhs (StgRhsClosure cc bi free_vars upd_flag args body)
808 = hang (hsep [if opt_SccProfilingOn then ppr cc else empty,
810 ifPprDebug (brackets (interppSP free_vars)),
811 char '\\' <> ppr upd_flag, brackets (interppSP args)])
814 pprStgRhs (StgRhsCon cc con args)
816 space, ppr con, ptext SLIT("! "), brackets (interppSP args)]
818 pprMaybeSRT (NoSRT) = empty
819 pprMaybeSRT srt = ptext SLIT("srt: ") <> pprSRT srt