- basic_thing_string
- = if friendly_sty then basic_thing else stringToC basic_thing
- in
- if print_as_string then
- uppBesides [uppChar '"', uppStr basic_thing_string, uppChar '"']
-
- else if friendly_sty then
- uppStr basic_thing
- else
- uppBesides [prefix_CC,
- prettyToUn (identToC (_PK_ basic_thing))]
- where
- friendly_sty = friendly_style sty
-
- ----------------
- do_cc DontCareCC = "DONT_CARE"
- do_cc (AllCafsCC m _) = if print_as_string
- then "CAFs_in_..."
- else "CAFs." ++ _UNPK_ m
- do_cc (AllDictsCC m _ d) = do_dupd d (
- if print_as_string
- then "DICTs_in_..."
- else "DICTs." ++ _UNPK_ m)
- do_cc PreludeCafsCC = if print_as_string
- then "CAFs_in_..."
- else "CAFs"
- do_cc (PreludeDictsCC d) = do_dupd d (
- if print_as_string
- then "DICTs_in_..."
- else "DICTs")
-
- do_cc (NormalCC kind mod_name grp_name is_dupd is_caf)
- = let
- basic_kind = do_caf is_caf ++ do_kind kind
- in
- if friendly_sty then
- do_dupd is_dupd (basic_kind ++ ('/': moduleString mod_name) ++ ('/': _UNPK_ grp_name))
- else
- basic_kind
- where
- do_caf IsCafCC = "CAF:"
- do_caf _ = ""
-
- do_kind (UserCC name) = _UNPK_ name
- do_kind (AutoCC id) = do_id id ++ (if friendly_sty then "/AUTO" else "")
- do_kind (DictCC id) = do_id id ++ (if friendly_sty then "/DICT" else "")
-
- do_id :: Id -> String
- do_id id
- = if print_as_string
- then getOccString id -- use occ name
- else showId sty id -- we really do
-
- ---------------
- do_dupd ADupdCC str = if friendly_sty then str ++ "/DUPD" else str
- do_dupd _ str = str
-
-friendly_style sty -- i.e., probably for human consumption
- = case sty of
- PprForUser -> True
- PprDebug -> True
- PprShowAll -> True
- _ -> False
-\end{code}
-
-Printing unfoldings is sufficiently weird that we do it separately.
-This should only apply to CostCentres that can be ``set to'' (cf
-@sccAbleCostCentre@). That excludes CAFs and
-`overhead'---which are added at the very end---but includes dictionaries.
-Dict \tr{_scc_}s may cross module boundaries to show ``scope'' info;
-even if we won't ultimately do a \tr{SET_CCC} from it.