Skip to content

Commit

Permalink
Add dumpcore flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPenner committed Nov 22, 2024
1 parent 936570f commit e3cdfa8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 5 additions & 1 deletion unison-runtime/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ flags:
stackchecks:
manual: true
default: false
dumpcore:
manual: true
default: false

when:
- condition: flag(arraychecks)
cpp-options: -DARRAY_CHECK
- condition: flag(stackchecks)
cpp-options: -DSTACK_CHECK

- condition: flag(dumpcore)
ghc-options: -ddump-simpl -ddump-stg-final -ddump-to-file -dsuppress-coercions -dsuppress-idinfo -dsuppress-module-prefixes # -dsuppress-type-applications -dsuppress-type-signatures

library:
source-dirs: src
Expand Down
2 changes: 1 addition & 1 deletion unison-runtime/src/Unison/Runtime/Machine.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ uprim1 !stk NOTB !i = do
pure stk
{-# INLINE uprim1 #-}

uprim2 :: (HasCallStack) => Stack -> UPrim2 -> Int -> Int -> IO Stack
uprim2 :: Stack -> UPrim2 -> Int -> Int -> IO Stack
uprim2 !stk ADDI !i !j = do
m <- upeekOff stk i
n <- upeekOff stk j
Expand Down
8 changes: 8 additions & 0 deletions unison-runtime/unison-runtime.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ flag arraychecks
manual: True
default: False

flag dumpcore
manual: True
default: False

flag stackchecks
manual: True
default: False
Expand Down Expand Up @@ -142,6 +146,8 @@ library
cpp-options: -DARRAY_CHECK
if flag(stackchecks)
cpp-options: -DSTACK_CHECK
if flag(dumpcore)
ghc-options: -ddump-simpl -ddump-stg-final -ddump-to-file -dsuppress-coercions -dsuppress-idinfo -dsuppress-module-prefixes

test-suite runtime-tests
type: exitcode-stdio-1.0
Expand Down Expand Up @@ -221,3 +227,5 @@ test-suite runtime-tests
cpp-options: -DARRAY_CHECK
if flag(stackchecks)
cpp-options: -DSTACK_CHECK
if flag(dumpcore)
ghc-options: -ddump-simpl -ddump-stg-final -ddump-to-file -dsuppress-coercions -dsuppress-idinfo -dsuppress-module-prefixes

0 comments on commit e3cdfa8

Please sign in to comment.