minor codegen bugfix: don't use names for closures that are also mangled Nim names

This commit is contained in:
Araq 2017-02-26 17:40:46 +01:00
commit 46b672a6c4
6 changed files with 17 additions and 17 deletions

View file

@ -427,7 +427,7 @@ proc genProcParams(m: BModule, t: PType, rettype, params: var Rope,
addf(params, " Result", [])
if t.callConv == ccClosure and declareEnvironment:
if params != nil: add(params, ", ")
add(params, "void* ClEnv")
add(params, "void* ClE_0")
if tfVarargs in t.flags:
if params != nil: add(params, ", ")
add(params, "...")
@ -678,8 +678,8 @@ proc getTypeDescAux(m: BModule, origTyp: PType, check: var IntSet): Rope =
[rope(CallingConvToStr[t.callConv]), rettype, result, desc])
else:
addf(m.s[cfsTypes], "typedef struct {$n" &
"N_NIMCALL_PTR($2, ClPrc) $3;$n" &
"void* ClEnv;$n} $1;$n",
"N_NIMCALL_PTR($2, ClP_0) $3;$n" &
"void* ClE_0;$n} $1;$n",
[result, rettype, desc])
of tySequence:
# we cannot use getTypeForward here because then t would be associated
@ -815,8 +815,8 @@ proc getClosureType(m: BModule, t: PType, kind: TClosureTypeKind): Rope =
[rope(CallingConvToStr[t.callConv]), rettype, result, desc])
else:
addf(m.s[cfsTypes], "typedef struct {$n" &
"N_NIMCALL_PTR($2, ClPrc) $3;$n" &
"void* ClEnv;$n} $1;$n",
"N_NIMCALL_PTR($2, ClP_0) $3;$n" &
"void* ClE_0;$n} $1;$n",
[result, rettype, desc])
proc finishTypeDescriptions(m: BModule) =