From 5a2720e99075166d2192fd40927f695f58124028 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Sun, 5 May 2013 00:42:16 +0300 Subject: bugfix: compiling after idetools usage is now possible in caas mode --- compiler/main.nim | 10 ++++++++++ tests/caas/def-def-compile.txt | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 tests/caas/def-def-compile.txt diff --git a/compiler/main.nim b/compiler/main.nim index 6e3b1a352..dde18825e 100644 --- a/compiler/main.nim +++ b/compiler/main.nim @@ -214,6 +214,9 @@ proc rodPass = if optSymbolFiles in gGlobalOptions: registerPass(rodwritePass) +proc codegenPass = + registerPass cgenPass + proc semanticPasses = registerPass verbosePass registerPass semPass @@ -381,6 +384,13 @@ proc CommandSuggest = msgs.gErrorMax = high(int) # do not stop after first error semanticPasses() rodPass() + if isServing: + # XXX: hacky work-around ahead + # Currently, it's possible to issue a idetools command, before + # issuing the first compile command. This will leave the compiler + # cache in a state where "no recompilation is necessary", but the + # cgen pass was never executed at all. + codegenPass() compileProject() if isServing: if optDef in gGlobalOptions: diff --git a/tests/caas/def-def-compile.txt b/tests/caas/def-def-compile.txt new file mode 100644 index 000000000..64002aff1 --- /dev/null +++ b/tests/caas/def-def-compile.txt @@ -0,0 +1,10 @@ +main.nim +> idetools --track:main.nim,5,18 --def main.nim +strutils.toUpper +SuccessX +> idetools --track:main.nim,5,18 --def main.nim +strutils.toUpper +SuccessX +> c +SuccessX + -- cgit 1.4.1-2-gfad0