, tcForeignExports
) where
-#include "config.h"
+#include "../includes/ghcconfig.h"
#include "HsVersions.h"
import HsSyn
import ErrUtils ( Message )
import Id ( Id, mkLocalId, mkExportedLocalId )
+#if alpha_TARGET_ARCH
+import PrimRep ( getPrimRepSize, isFloatingRep )
+import Type ( typePrimRep )
+#endif
import OccName ( mkForeignExportOcc )
import Name ( Name, NamedThing(..), mkExternalName )
import TcType ( Type, tcSplitFunTys, tcSplitTyConApp_maybe,
toDNType
)
import ForeignCall ( CExportSpec(..), CCallTarget(..),
+ CLabelString, isCLabelString,
isDynamicTarget, withDNTypes, DNKind(..), DNCallSpec(..) )
-import CStrings ( CLabelString, isCLabelString )
+import MachOp ( machRepByteWidth )
import PrelNames ( hasKey, ioTyConKey )
import CmdLineOpts ( dopt_HscLang, HscLang(..) )
import Outputable
#include "nativeGen/NCG.h"
#if alpha_TARGET_ARCH
checkFEDArgs arg_tys
- = check (integral_args <= 4) err
+ = check (integral_args <= 32) err
where
- integral_args = sum (map getPrimRepSize $
- filter (not . isFloatingRep) $
- map typePrimRep arg_tys)
+ integral_args = sum [ machRepByteWidth rep
+ | (rep,hint) <- map typeMachRepRep arg_tys,
+ hint /= FloatHint ]
err = ptext SLIT("On Alpha, I can only handle 4 non-floating-point arguments to foreign export dynamic")
#else
checkFEDArgs arg_tys = returnM ()