Skip to content

Commit 6161bfb

Browse files
committed
Address comments
1 parent 0e1d962 commit 6161bfb

File tree

10 files changed

+29
-2
lines changed

10 files changed

+29
-2
lines changed

plutus-core/plutus-core/src/PlutusCore/Builtin/Result.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,9 @@ We mark error-related definitions such as prisms like '_StructuralUnliftingError
164164
functions like 'throwNotAConstant' with @INLINE@, because this produces significantly less cluttered
165165
GHC Core. Not doing so results in 20+% larger Core for builtins.
166166
167-
However in a few specific cases we use @NOINLINE@ instead to get tighter Core. @NOINLINE@ is the same as
168-
@NOINLINE@ except the former _actually_ prevents GHC from inlining the definition unlike the latter.
167+
However in a few specific cases we use @NOINLINE@ instead to get tighter Core. @NOINLINE@ is the
168+
same as @OPAQUE@ except the latter _actually_ prevents GHC from inlining the definition unlike the
169+
former (we use the former because we currently have to support GHC-8.10).
169170
See this for details: https://github.com/ghc-proposals/ghc-proposals/blob/5577fd008924de8d89cfa9855fa454512e7dcc75/proposals/0415-opaque-pragma.rst
170171
171172
It's hard to predict where @NOINLINE@ instead of @INLINE@ will help to make GHC Core tidier, so it's

plutus-tx-plugin/test/Plugin/Data/Spec.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
-- editorconfig-checker-disable-file
22
{-# LANGUAGE BangPatterns #-}
3+
{-# LANGUAGE CPP #-}
34
{-# LANGUAGE DataKinds #-}
45
{-# LANGUAGE NegativeLiterals #-}
56
{-# LANGUAGE OverloadedStrings #-}
@@ -16,7 +17,9 @@
1617
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:context-level=0 #-}
1718
{-# OPTIONS_GHC -Wno-incomplete-patterns #-}
1819
{-# OPTIONS_GHC -Wno-name-shadowing #-}
20+
#if !MIN_VERSION_base(4, 15, 0)
1921
{-# OPTIONS_GHC -Wwarn=unrecognised-pragmas #-}
22+
#endif
2023

2124
module Plugin.Data.Spec where
2225

plutus-tx-plugin/test/Plugin/Laziness/Spec.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
-- editorconfig-checker-disable-file
2+
{-# LANGUAGE CPP #-}
23
{-# LANGUAGE DataKinds #-}
34
{-# LANGUAGE OverloadedStrings #-}
45
{-# LANGUAGE ScopedTypeVariables #-}
@@ -10,7 +11,9 @@
1011
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:max-simplifier-iterations-uplc=0 #-}
1112
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:max-cse-iterations=0 #-}
1213
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:context-level=0 #-}
14+
#if !MIN_VERSION_base(4, 15, 0)
1315
{-# OPTIONS_GHC -Wwarn=unrecognised-pragmas #-}
16+
#endif
1417

1518
module Plugin.Laziness.Spec where
1619

plutus-tx-plugin/test/Plugin/Typeclasses/Spec.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE DataKinds #-}
23
{-# LANGUAGE OverloadedStrings #-}
34
{-# LANGUAGE ScopedTypeVariables #-}
@@ -11,7 +12,9 @@
1112
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:max-cse-iterations=0 #-}
1213
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:context-level=0 #-}
1314
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:no-typecheck #-}
15+
#if !MIN_VERSION_base(4, 15, 0)
1416
{-# OPTIONS_GHC -Wwarn=unrecognised-pragmas #-}
17+
#endif
1518

1619
module Plugin.Typeclasses.Spec where
1720

plutus-tx/src/PlutusTx/Bool.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
{-# LANGUAGE CPP #-}
2+
#if !MIN_VERSION_base(4, 15, 0)
13
{-# OPTIONS_GHC -Wwarn=unrecognised-pragmas #-}
4+
#endif
25

36
module PlutusTx.Bool (Bool(..), (&&), (||), not, otherwise) where
47

plutus-tx/src/PlutusTx/Builtins/HasBuiltin.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE FlexibleContexts #-}
23
{-# LANGUAGE FlexibleInstances #-}
34
{-# LANGUAGE StandaloneKindSignatures #-}
45
{-# LANGUAGE TypeFamilies #-}
56
{-# LANGUAGE TypeOperators #-}
67

8+
#if !MIN_VERSION_base(4, 15, 0)
79
{-# OPTIONS_GHC -Wwarn=unrecognised-pragmas #-}
10+
#endif
811

912
module PlutusTx.Builtins.HasBuiltin where
1013

plutus-tx/src/PlutusTx/Builtins/HasOpaque.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
{-# OPTIONS_GHC -Wno-orphans #-}
1212
{-# OPTIONS_GHC -fno-omit-interface-pragmas #-}
1313
{-# OPTIONS_GHC -fno-specialise #-}
14+
#if !MIN_VERSION_base(4, 15, 0)
1415
{-# OPTIONS_GHC -Wwarn=unrecognised-pragmas #-}
16+
#endif
1517

1618
module PlutusTx.Builtins.HasOpaque where
1719

plutus-tx/src/PlutusTx/Function.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
{-# LANGUAGE CPP #-}
2+
#if !MIN_VERSION_base(4, 15, 0)
13
{-# OPTIONS_GHC -Wwarn=unrecognised-pragmas #-}
4+
#endif
25

36
module PlutusTx.Function (fix) where
47

plutus-tx/src/PlutusTx/Optimize/Inline.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
{-# LANGUAGE CPP #-}
2+
#if !MIN_VERSION_base(4, 15, 0)
13
{-# OPTIONS_GHC -Wwarn=unrecognised-pragmas #-}
4+
#endif
25

36
module PlutusTx.Optimize.Inline (inline) where
47

plutus-tx/src/PlutusTx/Plugin/Utils.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE DataKinds #-}
23
{-# LANGUAGE DerivingStrategies #-}
34
{-# LANGUAGE FlexibleContexts #-}
@@ -6,7 +7,9 @@
67

78
{-# OPTIONS_GHC -Wno-unused-foralls #-}
89
{-# OPTIONS_GHC -fomit-interface-pragmas #-}
10+
#if !MIN_VERSION_base(4, 15, 0)
911
{-# OPTIONS_GHC -Wwarn=unrecognised-pragmas #-}
12+
#endif
1013

1114
module PlutusTx.Plugin.Utils where
1215

0 commit comments

Comments
 (0)