From a0eca7518223a18f3633150de2c8d3c1c9e71560 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Wed, 4 Mar 2020 14:28:53 +0100 Subject: sink parameter inference for types that have destructors (#13544) * ensure capitalize doesn't take an inferred sink parameter * sink parameter inference: first version, for now disabled. Changed that sink parameters can be consumed multiple times in order to adhere to our spec. * sink inference can now be disabled with .nosinks; sometimes for proc type interop this is required * fixes yet another critical DFA bug * better implementation that also understands if expressions etc * document sink parameter inference and allow for global disabling --- compiler/wordrecg.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler/wordrecg.nim') diff --git a/compiler/wordrecg.nim b/compiler/wordrecg.nim index d03c22952..ed5d2649f 100644 --- a/compiler/wordrecg.nim +++ b/compiler/wordrecg.nim @@ -42,7 +42,7 @@ type wImportCompilerProc, wImportc, wImportJs, wExportc, wExportCpp, wExportNims, wIncompleteStruct, wRequiresInit, wAlign, wNodecl, wPure, wSideEffect, wHeader, - wNoSideEffect, wGcSafe, wNoreturn, wMerge, wLib, wDynlib, + wNoSideEffect, wGcSafe, wNoreturn, wNosinks, wMerge, wLib, wDynlib, wCompilerProc, wCore, wProcVar, wBase, wUsed, wFatal, wError, wWarning, wHint, wLine, wPush, wPop, wDefine, wUndef, wLineDir, wStackTrace, wLineTrace, wLink, wCompile, @@ -52,7 +52,7 @@ type wBoundChecks, wOverflowChecks, wNilChecks, wFloatChecks, wNanChecks, wInfChecks, wStyleChecks, wNonReloadable, wExecuteOnReload, - wAssertions, wPatterns, wTrMacros, wWarnings, + wAssertions, wPatterns, wTrMacros, wSinkInference, wWarnings, wHints, wOptimization, wRaises, wWrites, wReads, wSize, wEffects, wTags, wDeadCodeElimUnused, # deprecated, dead code elim always happens wSafecode, wPackage, wNoForward, wReorder, wNoRewrite, wNoDestroy, @@ -128,7 +128,7 @@ const "importcompilerproc", "importc", "importjs", "exportc", "exportcpp", "exportnims", "incompletestruct", "requiresinit", "align", "nodecl", "pure", "sideeffect", - "header", "nosideeffect", "gcsafe", "noreturn", "merge", "lib", "dynlib", + "header", "nosideeffect", "gcsafe", "noreturn", "nosinks", "merge", "lib", "dynlib", "compilerproc", "core", "procvar", "base", "used", "fatal", "error", "warning", "hint", "line", "push", "pop", "define", "undef", "linedir", "stacktrace", "linetrace", @@ -140,7 +140,7 @@ const "floatchecks", "nanchecks", "infchecks", "stylechecks", "nonreloadable", "executeonreload", - "assertions", "patterns", "trmacros", "warnings", "hints", + "assertions", "patterns", "trmacros", "sinkinference", "warnings", "hints", "optimization", "raises", "writes", "reads", "size", "effects", "tags", "deadcodeelim", # deprecated, dead code elim always happens "safecode", "package", "noforward", "reorder", "norewrite", "nodestroy", -- cgit 1.4.1-2-gfad0