Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
alexbiehl-gc
GHC
Commits
1ec8eb14
Commit
1ec8eb14
authored
27 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1997-06-05 20:39:04 by sof]
updated (and fixed!) printing of scc labels
parent
05dda376
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/compiler/profiling/CostCentre.lhs
+32
-17
32 additions, 17 deletions
ghc/compiler/profiling/CostCentre.lhs
with
32 additions
and
17 deletions
ghc/compiler/profiling/CostCentre.lhs
+
32
−
17
View file @
1ec8eb14
...
...
@@ -10,7 +10,7 @@ module CostCentre (
CostCentre, CcKind, IsDupdCC{-ToDo:rm-}, IsCafCC(..),
noCostCentre, subsumedCosts,
useCurrentCostCentre,
noCostCentreAttached, costsAreSubsumed,
noCostCentreAttached, costsAreSubsumed,
isCurrentCostCentre,
currentOrSubsumedCosts,
preludeCafsCostCentre, preludeDictsCostCentre,
overheadCostCentre, dontCareCostCentre,
...
...
@@ -32,11 +32,10 @@ IMP_Ubiq(){-uitous-}
import Id ( externallyVisibleId, GenId, showId, SYN_IE(Id) )
import CStrings ( identToC, stringToC )
import Name ( OccName, getOccString, moduleString )
import Name ( OccName, getOccString, moduleString
, nameString
)
import Outputable ( PprStyle(..), codeStyle, ifaceStyle )
import UniqSet
import Pretty
import Util
import Util
( panic, panic#, assertPanic, cmpPString, thenCmp, Ord3(..) )
pprIdInUnfolding = panic "Whoops"
\end{code}
...
...
@@ -151,6 +150,9 @@ preludeDictsCostCentre is_dupd
noCostCentreAttached NoCostCentre = True
noCostCentreAttached _ = False
isCurrentCostCentre CurrentCC = True
isCurrentCostCentre _ = False
costsAreSubsumed SubsumedCosts = True
costsAreSubsumed _ = False
...
...
@@ -388,18 +390,25 @@ uppCostCentre sty print_as_string cc
do_cc (NormalCC kind mod_name grp_name is_dupd is_caf)
= let
basic_kind = do_caf is_caf ++
moduleString mod_name ++
('/' : _UNPK_ grp_name) ++
('/' : do_kind kind)
basic_kind = do_kind kind
module_kind = do_caf is_caf (moduleString mod_name ++ '/':
basic_kind)
grp_str = if (_NULL_ grp_name) then mod_name else grp_name
full_kind = do_caf is_caf
(moduleString mod_name ++
('/' : _UNPK_ grp_str) ++
('/' : basic_kind))
in
if friendly_sty then
do_dupd is_dupd basic_kind
else
basic_kind
case sty of
PprForC -> do_caf is_caf basic_kind
_ ->
if friendly_sty then
do_dupd is_dupd full_kind
else
module_kind
where
do_caf IsCafCC = "CAF:"
do_caf _
= ""
do_caf IsCafCC
ls
= "CAF:"
++ ls
do_caf _
ls = ls
do_kind (UserCC name) = _UNPK_ name
do_kind (AutoCC id) = do_id id ++ (if friendly_sty then "/AUTO" else "")
...
...
@@ -416,8 +425,16 @@ uppCostCentre sty print_as_string cc
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
{-
friendly_style sty -- i.e., probably for human consumption
= not (codeStyle sty || ifaceStyle sty)
-}
\end{code}
Printing unfoldings is sufficiently weird that we do it separately.
...
...
@@ -446,9 +463,7 @@ upp_cc_uf cc@(NormalCC cc_kind m g is_dupd is_caf)
pp_kind (AutoCC id) = (<>) (ptext SLIT("_AUTO_CC_ ")) (show_id id)
pp_kind (DictCC id) = (<>) (ptext SLIT("_DICT_CC_ ")) (show_id id)
show_id id = pprIdInUnfolding no_in_scopes id
where
no_in_scopes = emptyUniqSet
show_id id = pprIdInUnfolding {-no_in_scopes-} id
pp_caf IsCafCC = ptext SLIT("_CAF_CC_")
pp_caf IsNotCafCC = ptext SLIT("_N_")
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment