File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,9 @@ filter p (x :: xs) with (p x)
55
55
and reverts to whole program compilation. Incremental compilation is currently
56
56
supported only by the Chez Scheme back end.
57
57
This is currently supported only on Unix-like platforms (not yet Windows)
58
+ - Note that you must set ` IDRIS2_INC_CGS ` when building and installing
59
+ all libraries you plan to link with an incremental build.
60
+ - Note also that this is experimental and not yet well tested!
58
61
* The type checker now tries a lot harder to avoid reducing expressions where
59
62
it is not needed. This gives a huge performance improvement in programs
60
63
that potentially do a lot of compile time evaluation. However, sometimes
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import Core.CompileExpr
8
8
import Core.Context
9
9
import Core.Context.Log
10
10
import Core.FC
11
+ import Core.Hash
11
12
import Core.Options
12
13
import Core.TT
13
14
@@ -514,6 +515,16 @@ mergeLamDef n
514
515
| Nothing => pure ()
515
516
setCompiled n ! (mergeLam cexpr)
516
517
518
+ export
519
+ addArityHash : {auto c : Ref Ctxt Defs} ->
520
+ Name -> Core ()
521
+ addArityHash n
522
+ = do defs <- get Ctxt
523
+ Just def <- lookupCtxtExact n (gamma defs) | Nothing => pure ()
524
+ let Just cexpr = compexpr def | Nothing => pure ()
525
+ let MkFun args _ = cexpr | _ => pure ()
526
+ addHash (n, length args)
527
+
517
528
export
518
529
compileAndInlineAll : {auto c : Ref Ctxt Defs} ->
519
530
Core ()
@@ -528,6 +539,11 @@ compileAndInlineAll
528
539
-- This seems to be the point where not much useful
529
540
-- happens any more.
530
541
traverse_ updateCallGraph cns
542
+ -- in incremental mode, add the arity of the definitions to the hash,
543
+ -- because if these change we need to recompile dependencies
544
+ -- accordingly
545
+ when (not (isNil (incrementalCGs ! getSession))) $
546
+ traverse_ addArityHash cns
531
547
where
532
548
transform : Nat -> List Name -> Core ()
533
549
transform Z cns = pure ()
You can’t perform that action at this time.
0 commit comments