This commit is contained in:
Andreas Rumpf 2020-07-08 18:59:34 +02:00 • committed by GitHub
commit bc712c28fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View file

@ -42,6 +42,7 @@ proc declareThreadVar(m: BModule, s: PSym, isExtern: bool) =
proc generateThreadLocalStorage(m: BModule) = proc generateThreadLocalStorage(m: BModule) =
if m.g.nimtv != nil and (usesThreadVars in m.flags or sfMainModule in m.module.flags): if m.g.nimtv != nil and (usesThreadVars in m.flags or sfMainModule in m.module.flags):
for t in items(m.g.nimtvDeps): discard getTypeDesc(m, t) for t in items(m.g.nimtvDeps): discard getTypeDesc(m, t)
finishTypeDescriptions(m)
m.s[cfsSeqTypes].addf("typedef struct {$1} NimThreadVars;$n", [m.g.nimtv]) m.s[cfsSeqTypes].addf("typedef struct {$1} NimThreadVars;$n", [m.g.nimtv])
proc generateThreadVarsSize(m: BModule) = proc generateThreadVarsSize(m: BModule) =

View file

@ -944,6 +944,7 @@ proc finishTypeDescriptions(m: BModule) =
else: else:
discard getTypeDescAux(m, t, check) discard getTypeDescAux(m, t, check)
inc(i) inc(i)
m.typeStack.setLen 0
template cgDeclFrmt*(s: PSym): string = template cgDeclFrmt*(s: PSym): string =
s.constraint.strVal s.constraint.strVal