Commit 5d5f7c6c authored by ken's avatar ken
Browse files

[project @ 2001-09-06 21:08:16 by ken]

Fix the code to *really* do the following:

On the Alpha we can only handle <= 4 integer arguments with foreign export
dynamic.  Following the example of the corresponding Sparc hack, we detect
when we're being asked to do something we can't and refuse.

MERGE TO STABLE BRANCH
parent 0a853c3e
......@@ -34,7 +34,7 @@ import Inst ( emptyLIE, LIE, plusLIE )
import ErrUtils ( Message )
import Id ( Id, mkLocalId )
import Name ( nameOccName )
import PrimRep ( getPrimRepSize )
import PrimRep ( getPrimRepSize, isFloatingRep )
import Type ( typePrimRep )
import TcType ( Type, tcSplitFunTys, tcSplitTyConApp_maybe, tcSplitForAllTys,
isFFIArgumentTy, isFFIImportResultTy,
......@@ -166,8 +166,9 @@ checkFEDArgs arg_tys
checkFEDArgs arg_tys
= check (integral_args <= 4) err
where
integral_args = sum (map (getPrimRepSize . filter (not . isFloatingRep)
. typePrimRep) arg_tys)
integral_args = sum (map getPrimRepSize $
filter (not . isFloatingRep) $
map typePrimRep arg_tys)
err = ptext SLIT("On Alpha, I can only handle 4 non-floating-point arguments to foreign export dynamic")
#else
checkFEDArgs arg_tys = returnNF_Tc ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment