From aacaac9b919d59ad7cd877f7619b0312b6a37594 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Mon, 11 Feb 2019 22:32:24 -0800 Subject: [PATCH] rename useFFI=>nimHasLibFFI; improve formatting rawExecute traceCode --- compiler/commands.nim | 2 +- compiler/main.nim | 2 +- compiler/options.nim | 4 ++-- compiler/vm.nim | 34 ++++++++++++---------------------- koch.nim | 6 +++--- 5 files changed, 19 insertions(+), 29 deletions(-) diff --git a/compiler/commands.nim b/compiler/commands.nim index af775f5cd2dd..56fe8f2057a5 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -34,7 +34,7 @@ bootSwitch(usedTinyC, hasTinyCBackend, "-d:tinyc") bootSwitch(usedNativeStacktrace, defined(nativeStackTrace) and nativeStackTraceSupported, "-d:nativeStackTrace") -bootSwitch(usedFFI, hasFFI, "-d:useFFI") +bootSwitch(usedFFI, hasFFI, "-d:nimHasLibFFI") type TCmdLinePass* = enum diff --git a/compiler/main.nim b/compiler/main.nim index 8cf0adb031dc..c1477a22bb89 100644 --- a/compiler/main.nim +++ b/compiler/main.nim @@ -107,7 +107,7 @@ when not defined(leanCompiler): proc interactivePasses(graph: ModuleGraph) = initDefines(graph.config.symbols) defineSymbol(graph.config.symbols, "nimscript") - # note: seems redundant with -d:useFFI + # note: seems redundant with -d:nimHasLibFFI when hasFFI: defineSymbol(graph.config.symbols, "nimffi") registerPass(graph, verbosePass) registerPass(graph, semPass) diff --git a/compiler/options.nim b/compiler/options.nim index b595e66c9891..c9f884986bad 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -18,7 +18,7 @@ const hasTinyCBackend* = defined(tinyc) useEffectSystem* = true useWriteTracking* = false - hasFFI* = defined(useFFI) + hasFFI* = defined(nimHasLibFFI) copyrightYear* = "2018" type # please make sure we have under 32 options @@ -129,7 +129,7 @@ type caseStmtMacros, codeReordering, compiletimeFFI, - ## This requires building nim with `-d:useFFI` + ## This requires building nim with `-d:nimHasLibFFI` ## which itself requires `nimble install libffi`, see #10150 ## Note: this feature can't be localized with {.push.} diff --git a/compiler/vm.nim b/compiler/vm.nim index f26990119abf..7493b008d238 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -483,8 +483,6 @@ const "compiler/vmdef.MaxLoopIterations and rebuild the compiler" errFieldXNotFound = "node lacks field: " -import strformat - proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg = var pc = start var tos = tos @@ -500,14 +498,14 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg = let ra = instr.regA when traceCode: - # echo "PC ", pc, " ", c.code[pc].opcode, " ra ", ra, " rb ", instr.regB, " rc ", instr.regC - let rb = instr.regB - let rbk = if rb