- ; let (args, arg_hints) = unzip cmm_args
- fc = ForeignConvention cconv arg_hints result_hints
- (call_args, cmm_target)
- = case target of
- StaticTarget lbl -> (args, CmmLit (CmmLabel
- (mkForeignLabel lbl (call_size args) False IsFunction)))
- DynamicTarget -> case args of
- fn:rest -> (rest, fn)
- [] -> panic "cgForeignCall []"
- call_target = ForeignTarget cmm_target fc
-
- ; srt <- getSRTInfo NoSRT -- SLPJ: Not sure what SRT
- -- is right here
+ ; let ((call_args, arg_hints), cmm_target)
+ = case target of
+ StaticTarget lbl mPkgId
+ -> let labelSource
+ = case mPkgId of
+ Nothing -> ForeignLabelInThisPackage
+ Just pkgId -> ForeignLabelInPackage pkgId
+ size = call_size cmm_args
+ in ( unzip cmm_args
+ , CmmLit (CmmLabel
+ (mkForeignLabel lbl size labelSource IsFunction)))
+
+ DynamicTarget -> case cmm_args of
+ (fn,_):rest -> (unzip rest, fn)
+ [] -> panic "cgForeignCall []"
+ fc = ForeignConvention cconv arg_hints result_hints
+ call_target = ForeignTarget cmm_target fc
+
+ ; srt <- getSRTInfo NoSRT -- SLPJ: Not sure what SRT
+ -- is right here