Skip to content

Commit 461fa9e

Browse files
committed
add changelog
1 parent d6258a1 commit 461fa9e

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### Added
2+
- `generate-callstack` option: When enabled, the plugin replaces every occurrence of `PlutusTx.Trace.callStack` with a `BuiltinString` containing the callstack at that relative point. Enabling this option incurs execution-cost overhead: it adds an extra callstack argument to all user-defined functions, and every time they are invoked it requires having extra application node for providing the current callstack. When `gennerate-callstack` is not enabled, `PlutusTx.Trace.callStack` is string "<CallStack>".
3+
4+

plutus-tx-plugin/src/PlutusTx/Compiler/Expr.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -613,12 +613,12 @@ ourselves before we start.
613613
-}
614614

615615
-- | Apply callstack to given term if given 'GHC.Var' requires callstack to be applied.
616-
applyCallStack
616+
applyCallStackWhenNeeded
617617
:: MonadState CompileState m
618618
=> GHC.Var
619619
-> PIRTerm PLC.DefaultUni PLC.DefaultFun
620620
-> m (PIRTerm PLC.DefaultUni PLC.DefaultFun)
621-
applyCallStack currVar t = do
621+
applyCallStackWhenNeeded currVar t = do
622622
csFuns <- gets csNeedsCallStack
623623
if Set.member (LexName $ GHC.varName currVar) csFuns
624624
then do
@@ -651,7 +651,7 @@ lookupTerm
651651
-> m (Maybe (PIRTerm PLC.DefaultUni PLC.DefaultFun))
652652
lookupTerm var =
653653
PIR.lookupTerm (LexName $ GHC.varName var)
654-
>>= traverse (applyCallStack var)
654+
>>= traverse (applyCallStackWhenNeeded var)
655655

656656
hoistExpr
657657
:: CompilingDefault uni fun m ann
@@ -744,7 +744,7 @@ hoistExpr var t = do
744744
PIR.modifyTermDef lexName (const $ PIR.Def var'' (t', PIR.NonStrict))
745745

746746
-- Apply callstack.
747-
applyCallStack var $ PIR.mkVar var''
747+
applyCallStackWhenNeeded var $ PIR.mkVar var''
748748

749749
maybeProfileRhs
750750
:: (CompilingDefault uni fun m ann) => PLCVar uni -> PIRTerm uni fun -> m (PIRTerm uni fun)

plutus-tx-plugin/src/PlutusTx/Compiler/Types.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
{-# LANGUAGE DataKinds #-}
44
{-# LANGUAGE FlexibleContexts #-}
55
{-# LANGUAGE FlexibleInstances #-}
6-
{-# LANGUAGE OverloadedStrings #-}
76
{-# LANGUAGE Rank2Types #-}
87
{-# LANGUAGE TypeFamilies #-}
98
{-# LANGUAGE TypeOperators #-}

0 commit comments

Comments
 (0)