Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
f3a1b28e
Commit
f3a1b28e
authored
Jun 13, 2011
by
Edward Z. Yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bake in ByteOff to ParamLocation, and remove ArgumentFormat synonym.
Signed-off-by:
Edward Z. Yang
<
ezyang@mit.edu
>
parent
8b3bfb2e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
11 deletions
+7
-11
compiler/cmm/CmmCallConv.hs
compiler/cmm/CmmCallConv.hs
+5
-8
compiler/cmm/MkGraph.hs
compiler/cmm/MkGraph.hs
+1
-1
compiler/cmm/cmm-notes
compiler/cmm/cmm-notes
+1
-2
No files found.
compiler/cmm/CmmCallConv.hs
View file @
f3a1b28e
module
CmmCallConv
(
ParamLocation
(
..
),
ArgumentFormat
,
assignArgumentsPos
)
where
...
...
@@ -19,21 +18,19 @@ import Outputable
-- Calculate the 'GlobalReg' or stack locations for function call
-- parameters as used by the Cmm calling convention.
data
ParamLocation
a
data
ParamLocation
=
RegisterParam
GlobalReg
|
StackParam
a
|
StackParam
ByteOff
instance
(
Outputable
a
)
=>
Outputable
(
ParamLocation
a
)
where
instance
Outputable
ParamLocation
where
ppr
(
RegisterParam
g
)
=
ppr
g
ppr
(
StackParam
p
)
=
ppr
p
type
ArgumentFormat
a
b
=
[(
a
,
ParamLocation
b
)]
-- | JD: For the new stack story, I want arguments passed on the stack to manifest as
-- positive offsets in a CallArea, not negative offsets from the stack pointer.
-- Also, I want byte offsets, not word offsets.
assignArgumentsPos
::
(
Outputable
a
)
=>
Convention
->
(
a
->
CmmType
)
->
[
a
]
->
ArgumentFormat
a
ByteOff
assignArgumentsPos
::
Convention
->
(
a
->
CmmType
)
->
[
a
]
->
[(
a
,
ParamLocation
)]
-- Given a list of arguments, and a function that tells their types,
-- return a list showing where each argument is passed
assignArgumentsPos
conv
arg_ty
reps
=
assignments
...
...
compiler/cmm/MkGraph.hs
View file @
f3a1b28e
...
...
@@ -355,7 +355,7 @@ copyOutOflow conv transfer area@(CallArea a) actuals updfr_off
else
(
[]
,
0
)
Old
->
(
[]
,
updfr_off
)
args
::
[(
CmmExpr
,
ParamLocation
ByteOff
)]
-- The argument and where to put it
args
::
[(
CmmExpr
,
ParamLocation
)]
-- The argument and where to put it
args
=
assignArgumentsPos
conv
cmmExprType
actuals
args'
=
foldl
adjust
setRA
args
...
...
compiler/cmm/cmm-notes
View file @
f3a1b28e
More notes (June 11)
~~~~~~~~~~~~~~~~~~~~
* Bake in ByteOff to ParamLocation and ArgumentFormat
CmmActuals -> [CmmActual] similary CmmFormals
* CmmActuals -> [CmmActual] similary CmmFormals
* Possible refactoring: Nuke AGraph in favour of
mkIfThenElse :: Expr -> Graph -> Graph -> FCode Graph
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment