diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2019-02-21 12:19:06 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-02-21 12:19:06 +0100 |
commit | 417d27c54406ac29ab00ac0b459aa7546af4b83a (patch) | |
tree | e346a018a1e3ee436efa0e645ee9c51e0bc105ee /compiler | |
parent | f2f0b5d695fbde2f9a8537b30e8422b22416ddbe (diff) | |
download | Nim-417d27c54406ac29ab00ac0b459aa7546af4b83a.tar.gz |
gc:destructors: progress
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ccgexprs.nim | 11 | ||||
-rw-r--r-- | compiler/ccgtypes.nim | 4 |
2 files changed, 6 insertions, 9 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index 5cf6df847..d459f6cbf 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -2614,20 +2614,15 @@ proc genConstSeqV2(p: BProc, n: PNode, t: PType): Rope = data.add genConstExpr(p, n.sons[i]) data.add("}") - result = getTempName(p.module) let payload = getTempName(p.module) let base = t.skipTypes(abstractInst).sons[0] appcg(p.module, cfsData, "static const struct {$n" & " NI cap; void* allocator; $1 data[$2];$n" & - "} $3 = {$2, NIM_NIL, $4};$n" & - "static NIM_CONST struct {$n" & - " NI len;$n" & - " $6 p;$n" & - "} $5 = {$2, ($6)&$3};$n", [ - getTypeDesc(p.module, base), rope(len(n)), payload, data, - result, getTypeDesc(p.module, t)]) + "} $3 = {$2, NIM_NIL, $4};$n", [ + getTypeDesc(p.module, base), rope(len(n)), payload, data]) + result = "{$1, ($2*)&$3}" % [rope(len(n)), getSeqPayloadType(p.module, t), payload] proc genConstExpr(p: BProc, n: PNode): Rope = case n.kind diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim index c557123ac..37d0827de 100644 --- a/compiler/ccgtypes.nim +++ b/compiler/ccgtypes.nim @@ -279,6 +279,7 @@ proc getSimpleTypeDesc(m: BModule, typ: PType): Rope = of tyString: case detectStrVersion(m) of 2: + discard cgsym(m, "NimStrPayload") discard cgsym(m, "NimStringV2") result = typeNameOrLiteral(m, typ, "NimStringV2") else: @@ -545,7 +546,8 @@ proc getRecordDesc(m: BModule, typ: PType, name: Rope, let popExSym = magicsys.getCompilerProc(m.g.graph, "popCurrentExceptionEx") if lfDynamicLib in popExSym.loc.flags and sfImportc in popExSym.flags: # echo popExSym.flags, " ma flags ", popExSym.loc.flags - result = "extern " & getTypeDescAux(m, popExSym.typ, check) & " " & mangleName(m, popExSym) & ";\L" & result + result = "extern " & getTypeDescAux(m, popExSym.typ, check) & " " & + mangleName(m, popExSym) & ";\L" & result else: result = genProcHeader(m, popExSym) & ";\L" & result hasField = true |