diff options
-rw-r--r-- | compiler/main.nim | 10 | ||||
-rw-r--r-- | tests/caas/def-def-compile.txt | 10 |
2 files changed, 20 insertions, 0 deletions
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 + |