summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ast.nim1
-rw-r--r--compiler/ccgtypes.nim4
-rw-r--r--compiler/nir/ast2ir.nim2
-rw-r--r--compiler/nir/types2ir.nim2
-rw-r--r--compiler/pragmas.nim2
5 files changed, 7 insertions, 4 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim
index ada4b6665..2db159013 100644
--- a/compiler/ast.nim
+++ b/compiler/ast.nim
@@ -36,6 +36,7 @@ type
     ccThisCall = "thiscall"         # thiscall (parameters are pushed right-to-left)
     ccClosure  = "closure"          # proc has a closure
     ccNoConvention = "noconv"       # needed for generating proper C procs sometimes
+    ccMember = "member"             # proc is a (cpp) member
 
   TNodeKinds* = set[TNodeKind]
 
diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim
index 3d1a3af6f..613beb9c5 100644
--- a/compiler/ccgtypes.nim
+++ b/compiler/ccgtypes.nim
@@ -288,7 +288,9 @@ const
     "N_STDCALL", "N_CDECL", "N_SAFECALL",
     "N_SYSCALL", # this is probably not correct for all platforms,
                  # but one can #define it to what one wants
-    "N_INLINE", "N_NOINLINE", "N_FASTCALL", "N_THISCALL", "N_CLOSURE", "N_NOCONV"]
+    "N_INLINE", "N_NOINLINE", "N_FASTCALL", "N_THISCALL", "N_CLOSURE", "N_NOCONV", 
+    "N_NOCONV" #ccMember is N_NOCONV
+    ]
 
 proc cacheGetType(tab: TypeCache; sig: SigHash): Rope =
   # returns nil if we need to declare this type
diff --git a/compiler/nir/ast2ir.nim b/compiler/nir/ast2ir.nim
index 907d45013..20dfbf2a7 100644
--- a/compiler/nir/ast2ir.nim
+++ b/compiler/nir/ast2ir.nim
@@ -2423,7 +2423,7 @@ proc addCallConv(c: var ProcCon; info: PackedLineInfo; callConv: TCallingConvent
   of ccInline: ann InlineCall
   of ccNoInline: ann NoinlineCall
   of ccThisCall: ann ThisCall
-  of ccNoConvention: ann NoCall
+  of ccNoConvention, ccMember: ann NoCall
 
 proc genProc(cOuter: var ProcCon; prc: PSym) =
   if prc.magic notin generatedMagics: return
diff --git a/compiler/nir/types2ir.nim b/compiler/nir/types2ir.nim
index cdadc4f0d..8d9583486 100644
--- a/compiler/nir/types2ir.nim
+++ b/compiler/nir/types2ir.nim
@@ -150,7 +150,7 @@ proc procToIr(c: var TypesCon; g: var TypeGraph; t: PType; addEnv = false): Type
   of ccInline: g.addAnnotation "__inline"
   of ccNoInline: g.addAnnotation "__noinline"
   of ccThisCall: g.addAnnotation "__thiscall"
-  of ccNoConvention: g.addAnnotation ""
+  of ccNoConvention, ccMember: g.addAnnotation ""
 
   for i in 0..<fieldTypes.len:
     g.addType fieldTypes[i]
diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim
index d85c52a93..a644639fe 100644
--- a/compiler/pragmas.nim
+++ b/compiler/pragmas.nim
@@ -241,7 +241,7 @@ proc processVirtual(c: PContext, n: PNode, s: PSym, flag: TSymFlag) =
   s.constraint.strVal = s.constraint.strVal % s.name.s
   s.flags.incl {flag, sfInfixCall, sfExportc, sfMangleCpp}
 
-  s.typ.callConv = ccNoConvention
+  s.typ.callConv = ccMember
   incl c.config.globalOptions, optMixedMode
 
 proc processCodegenDecl(c: PContext, n: PNode, sym: PSym) =