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
Tobias Decking
GHC
Commits
1276aa3f
Commit
1276aa3f
authored
Oct 01, 2004
by
simonpj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[project @ 2004-10-01 09:49:14 by simonpj]
Generate in the @size suffix for a stdcall symbol properly.
parent
352def90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
ghc/compiler/codeGen/CgForeignCall.hs
ghc/compiler/codeGen/CgForeignCall.hs
+12
-3
No files found.
ghc/compiler/codeGen/CgForeignCall.hs
View file @
1276aa3f
...
...
@@ -92,14 +92,23 @@ emitForeignCall results (CCall (CCallSpec target cconv safety)) args live
(
call_args
,
cmm_target
)
=
case
target
of
StaticTarget
lbl
->
(
args
,
CmmLit
(
CmmLabel
(
mkForeignLabel
lbl
Nothing
False
)))
-- ToDo: what about the size here?
-- it is currently tacked on by the NCG.
(
mkForeignLabel
lbl
call_size
False
)))
DynamicTarget
->
case
args
of
(
fn
,
_
)
:
rest
->
(
rest
,
fn
)
the_call
vols
=
CmmCall
(
CmmForeignCall
cmm_target
cconv
)
results
call_args
(
Just
vols
)
-- in the stdcall calling convention, the symbol needs @size appended
-- to it, where size is the total number of bytes of arguments. We
-- attach this info to the CLabel here, and the CLabel pretty printer
-- will generate the suffix when the label is printed.
call_size
|
StdCallConv
<-
cconv
=
Just
(
sum
(
map
(
arg_size
.
cmmExprRep
.
fst
)
args
))
|
otherwise
=
Nothing
-- ToDo: this might not be correct for 64-bit API
arg_size
rep
=
max
(
machRepByteWidth
rep
)
wORD_SIZE
emitForeignCall
results
(
DNCall
_
)
args
live
=
panic
"emitForeignCall: DNCall"
...
...
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