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
Model registry
Operate
Terraform modules
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
Reinier Maas
GHC
Commits
3bbd2bf2
Commit
3bbd2bf2
authored
2 years ago
by
Ben Gamari
Browse files
Options
Downloads
Patches
Plain Diff
compiler/tc: Small optimisation of evCallStack
Don't lookupIds unless we actually need them.
parent
317a915b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compiler/GHC/Tc/Types/EvTerm.hs
+4
-6
4 additions, 6 deletions
compiler/GHC/Tc/Types/EvTerm.hs
with
4 additions
and
6 deletions
compiler/GHC/Tc/Types/EvTerm.hs
+
4
−
6
View file @
3bbd2bf2
...
...
@@ -38,7 +38,9 @@ evDelayedError ty msg
evCallStack
::
(
MonadThings
m
,
HasModule
m
,
HasDynFlags
m
)
=>
EvCallStack
->
m
EvExpr
-- See Note [Overview of implicit CallStacks] in GHC.Tc.Types.Evidence
evCallStack
cs
=
do
evCallStack
EvCsEmpty
=
Var
<$>
lookupId
emptyCallStackName
evCallStack
(
EvCsPushCall
fs
loc
tm
)
=
do
df
<-
getDynFlags
let
platform
=
targetPlatform
df
m
<-
getModule
...
...
@@ -53,8 +55,6 @@ evCallStack cs = do
,
return
$
mkIntExprInt
platform
(
srcSpanEndCol
l
)
]
emptyCS
<-
Var
<$>
lookupId
emptyCallStackName
pushCSVar
<-
lookupId
pushCallStackName
let
pushCS
name
loc
rest
=
mkCoreApps
(
Var
pushCSVar
)
[
mkCoreTup
[
name
,
loc
],
rest
]
...
...
@@ -69,6 +69,4 @@ evCallStack cs = do
let
ip_co
=
unwrapIP
(
exprType
tm
)
return
(
pushCS
nameExpr
locExpr
(
Cast
tm
ip_co
))
case
cs
of
EvCsPushCall
fs
loc
tm
->
mkPush
fs
loc
tm
EvCsEmpty
->
return
emptyCS
mkPush
fs
loc
tm
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