diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2020-09-16 14:57:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-16 14:57:01 +0200 |
commit | fd31e8ff6f96527cc52125d01311d022ff82fead (patch) | |
tree | da6f772f157a34fc80316a6ba4888f8cbd730971 /compiler/cgen.nim | |
parent | 0aaf4e2dfa2d06a71202bd283e99bb017c781f2c (diff) | |
download | Nim-fd31e8ff6f96527cc52125d01311d022ff82fead.tar.gz |
allow old styled RTTI for arc/orc (#15331)
Diffstat (limited to 'compiler/cgen.nim')
-rw-r--r-- | compiler/cgen.nim | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim index d5e1e020c..242d1f89b 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -360,7 +360,10 @@ proc genObjectInit(p: BProc, section: TCProcSection, t: PType, a: var TLoc, while s.kind == tyObject and s[0] != nil: r.add(".Sup") s = skipTypes(s[0], skipPtrs) - linefmt(p, section, "$1.m_type = $2;$n", [r, genTypeInfo(p.module, t, a.lode.info)]) + if optTinyRtti in p.config.globalOptions: + linefmt(p, section, "$1.m_type = $2;$n", [r, genTypeInfoV2(p.module, t, a.lode.info)]) + else: + linefmt(p, section, "$1.m_type = $2;$n", [r, genTypeInfoV1(p.module, t, a.lode.info)]) of frEmbedded: if optTinyRtti in p.config.globalOptions: var tmp: TLoc @@ -376,7 +379,7 @@ proc genObjectInit(p: BProc, section: TCProcSection, t: PType, a: var TLoc, else: # worst case for performance: var r = if mode == constructObj: addrLoc(p.config, a) else: rdLoc(a) - linefmt(p, section, "#objectInit($1, $2);$n", [r, genTypeInfo(p.module, t, a.lode.info)]) + linefmt(p, section, "#objectInit($1, $2);$n", [r, genTypeInfoV1(p.module, t, a.lode.info)]) if isException(t): var r = rdLoc(a) @@ -417,7 +420,7 @@ proc resetLoc(p: BProc, loc: var TLoc) = specializeReset(p, loc) when false: linefmt(p, cpsStmts, "#genericReset((void*)$1, $2);$n", - [addrLoc(p.config, loc), genTypeInfo(p.module, loc.t, loc.lode.info)]) + [addrLoc(p.config, loc), genTypeInfoV1(p.module, loc.t, loc.lode.info)]) # XXX: generated reset procs should not touch the m_type # field, so disabling this should be safe: genObjectInit(p, cpsStmts, loc.t, loc, constructObj) |