projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Windows: print an error message in addDLL
[ghc-hetmet.git]
/
compiler
/
ghci
/
ByteCodeGen.lhs
diff --git
a/compiler/ghci/ByteCodeGen.lhs
b/compiler/ghci/ByteCodeGen.lhs
index
d395aa0
..
b45a643
100644
(file)
--- a/
compiler/ghci/ByteCodeGen.lhs
+++ b/
compiler/ghci/ByteCodeGen.lhs
@@
-49,7
+49,6
@@
import Constants
import Data.List
import Foreign
import Foreign.C
import Data.List
import Foreign
import Foreign.C
-import Control.Exception ( throwDyn )
import GHC.Exts ( Int(..), ByteArray# )
import GHC.Exts ( Int(..), ByteArray# )
@@
-950,9
+949,10
@@
generateCCall d0 s p (CCallSpec target cconv _) fn args_r_to_l
code_n_reps <- pargs d0 args_r_to_l
let
(pushs_arg, a_reps_pushed_r_to_l) = unzip code_n_reps
code_n_reps <- pargs d0 args_r_to_l
let
(pushs_arg, a_reps_pushed_r_to_l) = unzip code_n_reps
+ a_reps_sizeW = sum (map primRepSizeW a_reps_pushed_r_to_l)
push_args = concatOL pushs_arg
push_args = concatOL pushs_arg
- d_after_args = d0 + sum (map primRepSizeW a_reps_pushed_r_to_l)
+ d_after_args = d0 + a_reps_sizeW
a_reps_pushed_RAW
| null a_reps_pushed_r_to_l || head a_reps_pushed_r_to_l /= VoidRep
= panic "ByteCodeGen.generateCCall: missing or invalid World token?"
a_reps_pushed_RAW
| null a_reps_pushed_r_to_l || head a_reps_pushed_r_to_l /= VoidRep
= panic "ByteCodeGen.generateCCall: missing or invalid World token?"
@@
-1009,8
+1009,18
@@
generateCCall d0 s p (CCallSpec target cconv _) fn args_r_to_l
DynamicTarget
-> return (False, panic "ByteCodeGen.generateCCall(dyn)")
StaticTarget target
DynamicTarget
-> return (False, panic "ByteCodeGen.generateCCall(dyn)")
StaticTarget target
- -> do res <- ioToBc (lookupStaticPtr target)
+ -> do res <- ioToBc (lookupStaticPtr stdcall_adj_target)
return (True, res)
return (True, res)
+ where
+ stdcall_adj_target
+#ifdef mingw32_TARGET_OS
+ | StdCallConv <- cconv
+ = let size = a_reps_sizeW * wORD_SIZE in
+ mkFastString (unpackFS target ++ '@':show size)
+#endif
+ | otherwise
+ = target
+
-- in
(is_static, static_target_addr) <- get_target_info
let
-- in
(is_static, static_target_addr) <- get_target_info
let
@@
-1390,7
+1400,7
@@
idSizeW id = cgRepSizeW (typeCgRep (idType id))
-- See bug #1257
unboxedTupleException :: a
unboxedTupleException
-- See bug #1257
unboxedTupleException :: a
unboxedTupleException
- = throwDyn
+ = ghcError
(ProgramError
("Error: bytecode compiler can't handle unboxed tuples.\n"++
" Possibly due to foreign import/export decls in source.\n"++
(ProgramError
("Error: bytecode compiler can't handle unboxed tuples.\n"++
" Possibly due to foreign import/export decls in source.\n"++