2 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1996
4 \section[Calling conventions]{External calling conventions}
19 #include "HsVersions.h"
22 import PrimRep ( PrimRep, getPrimRepSizeInBytes )
28 pprCallConv :: CallConv -> SDoc
29 pprCallConv 0 = ptext SLIT("__stdcall")
30 pprCallConv _ = ptext SLIT("_ccall")
32 stdCallConv :: CallConv
38 defaultCallConv :: CallConv
39 defaultCallConv = cCallConv
41 callConvToInt :: CallConv -> Int
45 Generate the gcc attribute corresponding to the given
46 calling convention (used by PprAbsC):
48 ToDo: The stdcall calling convention is x86 (win32) specific,
49 so perhaps we should emit a warning if it's being used on other
53 callConvAttribute :: CallConv -> String
55 | cc == stdCallConv = "__stdcall"
56 | cc == cCallConv = ""
57 | otherwise = panic ("callConvAttribute: cannot handle" ++ showSDoc (pprCallConv cc))