From e3cdfa8a2f75afe0b04598210db8229bd11d6d8b Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Thu, 21 Nov 2024 13:40:07 -0800 Subject: [PATCH] Add dumpcore flag --- unison-runtime/package.yaml | 6 +++++- unison-runtime/src/Unison/Runtime/Machine.hs | 2 +- unison-runtime/unison-runtime.cabal | 8 ++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/unison-runtime/package.yaml b/unison-runtime/package.yaml index e9221c6d3e..850a83046c 100644 --- a/unison-runtime/package.yaml +++ b/unison-runtime/package.yaml @@ -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 diff --git a/unison-runtime/src/Unison/Runtime/Machine.hs b/unison-runtime/src/Unison/Runtime/Machine.hs index 1143d579fa..e0bac70278 100644 --- a/unison-runtime/src/Unison/Runtime/Machine.hs +++ b/unison-runtime/src/Unison/Runtime/Machine.hs @@ -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 diff --git a/unison-runtime/unison-runtime.cabal b/unison-runtime/unison-runtime.cabal index cc6e59bc6a..a23132a3f9 100644 --- a/unison-runtime/unison-runtime.cabal +++ b/unison-runtime/unison-runtime.cabal @@ -21,6 +21,10 @@ flag arraychecks manual: True default: False +flag dumpcore + manual: True + default: False + flag stackchecks manual: True default: False @@ -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 @@ -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