diff options
author | Michael D. Adams <t-madams@microsoft.com> | 2007-05-16 15:57:58 +0000 |
---|---|---|
committer | Michael D. Adams <t-madams@microsoft.com> | 2007-05-16 15:57:58 +0000 |
commit | 8e3b5645e0bab683444c81bbbac87e2df6799959 (patch) | |
tree | 30b172e8d7a11c59c44e4722d983f1cce1392bfe /compiler/cmm/CmmParse.y | |
parent | f2cc8b5bc34519a65581dc40b7bfebac97bffd73 (diff) | |
download | haskell-8e3b5645e0bab683444c81bbbac87e2df6799959.tar.gz |
Added "C--" foreign calling convention
Diffstat (limited to 'compiler/cmm/CmmParse.y')
-rw-r--r-- | compiler/cmm/CmmParse.y | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/compiler/cmm/CmmParse.y b/compiler/cmm/CmmParse.y index 38c30b24f5..3842e65051 100644 --- a/compiler/cmm/CmmParse.y +++ b/compiler/cmm/CmmParse.y @@ -767,15 +767,17 @@ foreignCall -> ExtFCode CmmExpr -> [ExtFCode (CmmExpr,MachHint)] -> Maybe [GlobalReg] -> P ExtCode -foreignCall "C" results_code expr_code args_code vols - = return $ do - results <- sequence results_code - expr <- expr_code - args <- sequence args_code - code (emitForeignCall' PlayRisky results - (CmmForeignCall expr CCallConv) args vols) -foreignCall conv _ _ _ _ - = fail ("unknown calling convention: " ++ conv) +foreignCall conv_string results_code expr_code args_code vols + = do convention <- case conv_string of + "C" -> return CCallConv + "C--" -> return CmmCallConv + _ -> fail ("unknown calling convention: " ++ conv_string) + return $ do + results <- sequence results_code + expr <- expr_code + args <- sequence args_code + code (emitForeignCall' PlayRisky results + (CmmForeignCall expr convention) args vols) where primCall :: [ExtFCode (CmmReg,MachHint)] |