diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-02-01 23:39:33 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-02-01 23:39:40 +0100 |
commit | d9cf9b079ec7f60dc246c93a73a3aa500ba03d42 (patch) | |
tree | 8fa6002af7a97b81daa22fff1c0bfb9d8a697595 /compiler | |
parent | 05fe52383235bc0f0435260ea2296182effdfd1b (diff) | |
download | Nim-d9cf9b079ec7f60dc246c93a73a3aa500ba03d42.tar.gz |
tiny progress on the name mangling
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ccgtypes.nim | 9 | ||||
-rw-r--r-- | compiler/cgendata.nim | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim index 8a11f954f..ccf4545ac 100644 --- a/compiler/ccgtypes.nim +++ b/compiler/ccgtypes.nim @@ -116,6 +116,13 @@ proc mangleName(m: BModule; s: PSym): Rope = add(result, m.idOrSig(s)) s.loc.r = result +template mangleParamName(m: BModule; s: PSym): Rope = mangleName(m, s) + +when false: + proc mangleName(p: BProc; s: PSym): Rope = + assert s.kind in skLocalVars + if sfGlobal in s.flags: return mangleName(p.module, s) + if isKeyword(s.name): discard const irrelevantForBackend = {tyGenericBody, tyGenericInst, tyGenericInvocation, @@ -393,7 +400,7 @@ proc genProcParams(m: BModule, t: PType, rettype, params: var Rope, var param = t.n.sons[i].sym if isCompileTimeOnly(param.typ): continue if params != nil: add(params, ~", ") - fillLoc(param.loc, locParam, param.typ, mangleName(m, param), + fillLoc(param.loc, locParam, param.typ, mangleParamName(m, param), param.paramStorageLoc) if ccgIntroducedPtr(param): add(params, getTypeDescWeak(m, param.typ, check)) diff --git a/compiler/cgendata.nim b/compiler/cgendata.nim index 8446b9db2..77d031d71 100644 --- a/compiler/cgendata.nim +++ b/compiler/cgendata.nim @@ -56,7 +56,7 @@ type BProc* = ref TCProc TBlock*{.final.} = object id*: int # the ID of the label; positive means that it - label*: Rope # generated text for the label + label*: Rope # generated text for the label # nil if label is not used sections*: TCProcSections # the code beloging isLoop*: bool # whether block is a loop |