summary refs log tree commit diff stats
path: root/compiler/ast.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2020-08-11 14:50:46 +0200
committerGitHub <noreply@github.com>2020-08-11 14:50:46 +0200
commit813f16a2a39f1375b241cf50845f641ea44d890e (patch)
treea5c45d5ead15167ded8d9d9dcef87dbf52013a38 /compiler/ast.nim
parent963db9e7dac39f4238f013addfae36439318b67f (diff)
parentb022576ce96f5c166c7f5684bef9de682704cb1b (diff)
downloadNim-813f16a2a39f1375b241cf50845f641ea44d890e.tar.gz
Fix #8473 (#15169)
* Make explicit {.nimcall.} a seperate calling convention

* Add testcase for #5688

* Fix bootstrapping

* Remove little lies :)

* Use typeflag instead
Diffstat (limited to 'compiler/ast.nim')
-rw-r--r--compiler/ast.nim5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim
index 1e619e51b..62c1e3894 100644
--- a/compiler/ast.nim
+++ b/compiler/ast.nim
@@ -17,7 +17,7 @@ export int128
 
 type
   TCallingConvention* = enum
-    ccDefault,                # proc has no explicit calling convention
+    ccNimCall,                # nimcall, also the default
     ccStdCall,                # procedure is stdcall
     ccCDecl,                  # cdecl
     ccSafeCall,               # safecall
@@ -30,7 +30,7 @@ type
     ccNoConvention            # needed for generating proper C procs sometimes
 
 const
-  CallingConvToStr*: array[TCallingConvention, string] = ["", "stdcall",
+  CallingConvToStr*: array[TCallingConvention, string] = ["nimcall", "stdcall",
     "cdecl", "safecall", "syscall", "inline", "noinline", "fastcall", "thiscall",
     "closure", "noconv"]
 
@@ -560,6 +560,7 @@ type
     tfCompleteStruct
       # (for importc types); type is fully specified, allowing to compute
       # sizeof, alignof, offsetof at CT
+    tfExplicitCallConv
 
   TTypeFlags* = set[TTypeFlag]