Skip to content

Commit

Permalink
[ fix ] Disable top-level constants optimisation during incremental c…
Browse files Browse the repository at this point in the history
…ompilation

The optimisation for non-recursive top-level constants introduced in
 #2817 accidentally breaks incremental compilation when an optimised
top-level constant is referenced in another module (noticeable in
larger, non-trivial programs, e.g. when building Idris itself in
incremental mode).

Since incremental compilation currently has no way to know about
constants in other modules, this commit sets the list of constants to
`empty` (as is done in the `ChezSep` backend) which allows successful
compilation.
  • Loading branch information
cypheon authored and mattpolzin committed Jan 14, 2024
1 parent 844ea28 commit 6c70048
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Compiler/Scheme/Chez.idr
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ incCompile c s sourceFile
version <- coreLift $ chezVersion chez
fgndefs <- traverse (getFgnCall version) ndefs
(sortedDefs, constants) <- sortDefs ndefs
compdefs <- traverse (getScheme constants (chezExtPrim constants) chezString) sortedDefs
compdefs <- traverse (getScheme empty (chezExtPrim empty) chezString) sortedDefs
let code = concat $ map snd fgndefs ++ compdefs
Right () <- coreLift $ writeFile ssFile $ build code
| Left err => throw (FileErr ssFile err)
Expand Down

0 comments on commit 6c70048

Please sign in to comment.