[GHC] #11676: Preserve name of original function in worker name

#11676: Preserve name of original function in worker name -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: feature | Status: new request | Priority: low | Milestone: Component: Compiler | Version: 7.10.3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Other Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Currently it's not uncommon to find workers named, e.g., `$wa` while perusing Core. When you find one of these you need to then go searching for its associated wrapper to discover which function the worker implements. Then you need to work hard to keep this piece of information in your mental state. This is unfortunate and makes reading Core unnecessarily hard. Why not name the worker of `thisIsAFunction` something like, e.g., `thisIsAFunction$wa`? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11676 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11676: Preserve name of original function in worker name -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: feature request | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): It is. The worker for `foo` is `$wfoo`. So the function was called `a` in this case. So the culprit is not worker/wrapper, but something else. At a guess, it's `Simplify.makeTrivialWithInfo` which could use a more informative `OccName`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11676#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11676: Preserve name of original function in worker name -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: feature request | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Indeed I just noticed that the name should be derived while browsing the source. `makeTrivialWithInfo` sounds quite likely; thanks for that reference, it would have taken quite a while for me to find that myself. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11676#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11676: Preserve name of original function in worker name -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: feature request | Status: patch Priority: low | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1970 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D1970 Comment: Phab:D1970 is an attempt at coercing `makeTrivialWithInfo` into generating more useful names. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11676#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11676: Preserve name of original function in worker name
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner:
Type: feature request | Status: patch
Priority: low | Milestone:
Component: Compiler | Version: 7.10.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: Other | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D1970
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#11676: Preserve name of original function in worker name -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: feature request | Status: patch Priority: low | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1970 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): I unfortunately just noticed that the commit message of the commit in comment:4 no longer reflects what the commit itself implements. The simplifier does not maintain a stack of contexts; instead we simply pass the context name in from the various call-sites of `makeTrivial` and friends. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11676#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11676: Preserve name of original function in worker name -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: feature request | Status: closed Priority: low | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1970 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: => 8.0.1 Comment: Merged as bceb5becdb408316580c970c1f75cbde92a4f9e6. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11676#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC