diff --git a/Nim b/Nim index 1ac3120..e322c95 160000 --- a/Nim +++ b/Nim @@ -1 +1 @@ -Subproject commit 1ac3120ebd1828afd6537cba6e8f85f510aa867a +Subproject commit e322c95cab474c980ed579d5d674f8de05c8a0ef diff --git a/nlvm/llgen.nim b/nlvm/llgen.nim index 2c54ae3..2f36737 100644 --- a/nlvm/llgen.nim +++ b/nlvm/llgen.nim @@ -2205,7 +2205,7 @@ proc genTypeInfoInit(g: LLGen, t: PType, ntlt, lt: llvm.TypeRef, var flags = 0'i8 if not containsGarbageCollectedRef(t): flags = flags or 1 - if not canFormAcycle(t) or (t.kind == tyProc and t.callConv == ccClosure): + if not g.graph.canFormAcycle(t) or (t.kind == tyProc and t.callConv == ccClosure): flags = flags or 2 if t.kind == tyEnum: var hasHoles = false @@ -2612,7 +2612,7 @@ proc genTypeInfoV2(g: LLGen, typ: PType): llvm.ValueRef = g.typeInfosV2[sig] = result var flags = 0 - if not canFormAcycle(typ): flags = flags or 1 + if not g.graph.canFormAcycle(typ): flags = flags or 1 let dl = g.m.getModuleDataLayout() lt = g.llType(typ) @@ -5397,8 +5397,9 @@ proc genClosureVar(g: LLGen, n: PNode) = let x = g.genNode(n[0], false) if n[2].kind == nkEmpty: - g.buildStoreNull(g.llType(n[0].typ), x.v) - g.genObjectInit(n[0].typ, x.v) + if sfNoInit notin n[0][1].sym.flags: + g.buildStoreNull(g.llType(n[0].typ), x.v) + g.genObjectInit(n[0].typ, x.v) else: let bx = g.genCallOrNode(n[0], n[2], x) @@ -5627,7 +5628,7 @@ proc rawGenNew(g: LLGen, dest: LLValue, sizeExpr: llvm.ValueRef, typ: PType) = if dest.storage == OnHeap and usesWriteBarrier(g.config): let destl = g.buildLoadValue(g.llType(refType), dest) g.withNotNil(destl.v): - if canFormAcycle(typ): + if g.graph.canFormAcycle(typ): discard g.callCompilerProc("nimGCunrefRC1", [destl.v]) else: discard g.callCompilerProc("nimGCunrefNoCycle", [destl.v]) @@ -5706,7 +5707,7 @@ proc genNewSeqAux(g: LLGen, dest: LLValue, destTyp: PType, len: llvm.ValueRef) = if dest.storage == OnHeap and usesWriteBarrier(g.config): let destl = g.buildLoadValue(g.llType(destTyp), dest) g.withNotNil(destl.v): - if canFormAcycle(destTyp): + if g.graph.canFormAcycle(destTyp): discard g.callCompilerProc("nimGCunrefRC1", [destl.v]) else: discard g.callCompilerProc("nimGCunrefNoCycle", [destl.v]) @@ -7122,7 +7123,7 @@ proc genMagic(g: LLGen, n: PNode, load: bool, dest: LLValue): LLValue = of mGetTypeInfo: result = g.genMagicGetTypeInfo(n) of mGetTypeInfoV2: result = g.genMagicGetTypeInfoV2(n) of mAccessTypeField: result = g.genMagicAccessTypeField(n, load) - of mIsolate, mFinished: + of generatedMagics: # TODO these are magics, but for some reason they don't have the loc.r set result = g.genCall(nil, n, load, dest) of mSlice: result = g.genMagicSlice(n, load) diff --git a/skipped-tests.txt b/skipped-tests.txt index 13b4fc3..fc26225 100644 --- a/skipped-tests.txt +++ b/skipped-tests.txt @@ -9,11 +9,11 @@ tests/arc/tdeepcopy.nim c tests/arc/thard_alignment.nim c tests/arc/tmarshal.nim c tests/assert/tassert_c.nim c -tests/async/tasyncssl.nim c tests/async/tasync_traceback.nim c tests/avr/thello.nim c tests/casestmt/t7699.nim c tests/ccgbugs2/tinefficient_const_table.nim c +tests/ccgbugs/t10964.nim c tests/ccgbugs/t16027.nim c tests/ccgbugs/t19445.nim c --nimcache:tests/ccgbugs/nimcache19445 --cincludes:nimcache19445 --header:m19445 tests/ccgbugs/tassign_nil_strings.nim c @@ -28,6 +28,7 @@ tests/ccgbugs/tprogmem.nim c tests/ccgbugs/tunsafeaddr.nim c tests/closure/ttimeinfo.nim c tests/compiler/t12684.nim c +tests/compiler/tcmdlineclib.nim c tests/converter/tgenericconverter.nim c tests/coroutines/tgc.nim c --gc:arc tests/coroutines/tgc.nim c --gc:orc @@ -55,6 +56,7 @@ tests/dll/visibility.nim c -d:release --gc:boehm tests/dll/visibility.nim c --gc:boehm tests/effects/tdiagnostic_messages.nim c tests/effects/tstrict_funcs_imports.nim c +tests/errmsgs/t14444.nim c --hints:off tests/errmsgs/tcall_with_default_arg.nim c tests/errmsgs/tproper_stacktrace2.nim c tests/errmsgs/tproper_stacktrace3.nim c @@ -88,7 +90,9 @@ tests/manyloc/standalone2/tavr.nim c tests/manyloc/standalone/barebone.nim c tests/method/tmethod_issues.nim c --mm:arc tests/method/tmethod_issues.nim c --mm:refc +tests/misc/t15955.nim c tests/misc/t18077.nim c +tests/misc/t19046.nim c --threads:on tests/misc/t9710.nim c --debugger:native tests/misc/tapp_lib_staticlib.nim c tests/misc/temit.nim c @@ -125,10 +129,10 @@ tests/parallel/tmissing_deepcopy.nim c tests/pragmas/tbitsize.nim c tests/pragmas/tnoreturn.nim c tests/realtimeGC/tmain.nim c +tests/sets/t20997.nim c tests/stdlib/tlwip.nim c tests/stdlib/tosproc.nim c tests/stdlib/tsqlitebindatas.nim c -tests/stdlib/tssl.nim c tests/stdlib/tstackframes.nim c tests/stdlib/tstdlib_various.nim c tests/stdlib/tvarints.nim c