Make explicit {.nimcall.} a seperate calling convention

This commit is contained in:
Clyybber 2020-08-08 12:36:20 +02:00
commit 38068f9778
12 changed files with 29 additions and 17 deletions

View file

@ -17,7 +17,8 @@ export int128
type
TCallingConvention* = enum
ccDefault, # proc has no explicit calling convention
ccImplicit, # proc has no explicit calling convention
ccNimCall, # proc was explicitly marked as nimcall
ccStdCall, # procedure is stdcall
ccCDecl, # cdecl
ccSafeCall, # safecall
@ -30,10 +31,12 @@ type
ccNoConvention # needed for generating proper C procs sometimes
const
CallingConvToStr*: array[TCallingConvention, string] = ["", "stdcall",
ccDefault* = {ccImplicit, ccNimCall}
CallingConvToStr*: array[TCallingConvention, string] = ["", "nimcall", "stdcall",
"cdecl", "safecall", "syscall", "inline", "noinline", "fastcall", "thiscall",
"closure", "noconv"]
type
TNodeKind* = enum # order is extremely important, because ranges are used
# to check whether a node belongs to a certain class