Skip to content

Commit 239040c

Browse files
committed
wip
1 parent df43423 commit 239040c

File tree

15 files changed

+107
-71
lines changed

15 files changed

+107
-71
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ stack.yaml.lock
4848
*.dyn_hi
4949
*.chi
5050
*.chs.h
51+
*.prof
5152
.liquid/
5253

5354
# Agda

cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ packages: cardano-constitution
2727
plutus-metatheory
2828
plutus-tx
2929
plutus-tx-plugin
30-
plutus-profiled-plugin-test
3130
doc/docusaurus/docusaurus-examples.cabal
31+
--plutus-profiled-plugin-test
3232

3333
-- We never, ever, want this.
3434
write-ghc-environment-files: never

nix/outputs.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ let
107107
ghc912 = mkShell "ghc912";
108108
ghc96-profiled = mkShell "ghc96-profiled";
109109
ghc96-plugin = mkShell "ghc96-plugin";
110+
ghc96-plugin2 = mkShell "ghc96-plugin2";
110111
metatheory-jailbreak = metatheory-jailbreak-shell;
111112
};
112113

@@ -122,6 +123,7 @@ let
122123
{ devShells.ghc96 = devShells.ghc96; } //
123124
{ devShells.ghc912 = devShells.ghc912; } //
124125
{ devShells.ghc96-plugin = devShells.ghc96-plugin; } //
126+
{ devShells.ghc96-plugin2 = devShells.ghc96-plugin2; } //
125127
{ devShells.metatheory-jailbreak = metatheory-jailbreak-shell; } //
126128
{ inherit test-profiled-ghc; } //
127129
{ required = hydra-required-job; };
@@ -131,6 +133,7 @@ let
131133
{ devShells.ghc96 = devShells.ghc96; } //
132134
{ devShells.ghc912 = devShells.ghc912; } //
133135
{ devShells.ghc96-plugin = devShells.ghc96-plugin; } //
136+
{ devShells.ghc96-plugin2 = devShells.ghc96-plugin2; } //
134137
{ devShells.metatheory-jailbreak = metatheory-jailbreak-shell; } //
135138
{ inherit test-profiled-ghc; } //
136139
{ required = hydra-required-job; };

nix/project.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ let
2222
}];
2323
ghc96-plugin = {
2424
ghcOverride = pkgs.haskell-nix.compiler.ghc967.override {
25-
extraFlavourTransformers = [ "perf+profiled_ghc+debug_info+no_dynamic_ghc" ];
25+
extraFlavourTransformers = [ "+profiled_ghc+no_dynamic_ghc" ];
2626
ghc-patches = [ ./profiled-ghc-964.patch ];
2727
};
2828
modules = [{

plutus-profiled-plugin-test/help.sh

Lines changed: 0 additions & 51 deletions
This file was deleted.

plutus-profiled-plugin-test/plutus-profiled-plugin-test.cabal

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,14 @@ library
1313
, ghc
1414

1515
default-language: Haskell2010
16+
17+
executable simple-plugin-test
18+
main-is: SimpleMain.hs
19+
ghc-options: -main-is SimpleMain
20+
hs-source-dirs: src
21+
build-depends:
22+
, base >=4.9 && <5
23+
, plutus-profiled-plugin-test
24+
, ghc
25+
26+
default-language: Haskell2010
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{-# OPTIONS -fplugin LuitePlugin -fplugin-opt LuitePlugin:test #-}
2+
3+
module LuiteMain where
4+
5+
main :: IO ()
6+
main = putStrLn "Hello, Haskell!"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module LuitePlugin (plugin) where
2+
3+
import GHC.Plugins
4+
5+
plugin :: Plugin
6+
plugin = defaultPlugin {
7+
installCoreToDos = install
8+
}
9+
10+
install :: [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo]
11+
install _ todo = {-# SCC plugin_install #-} do
12+
putMsgS ("Hello! " ++ show (fib 40))
13+
return todo
14+
15+
fib :: Integer -> Integer
16+
fib 0 = 0
17+
fib 1 = 1
18+
fib n = fib (n-2) + fib (n-1)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{-# OPTIONS -fplugin SimplePlugin -fplugin-opt SimplePlugin:test #-}
2+
3+
module SimpleMain where
4+
5+
main :: IO ()
6+
main = putStrLn "Hello, Haskell!"

plutus-profiled-plugin-test/src/SimplePlugin.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ plugin =
1212
liftIO $ threadDelay 1000000
1313
return True
1414

15+
1516
b <-
16-
{-# SCC "XXXXxXXXXXXXXXX" #-}
17+
{-# SCC "WOWREALLY?" #-}
1718
getBool
1819
putMsgS ("I got a bool from the plugin -> " ++ show b)
1920
pure todos

0 commit comments

Comments
 (0)