Skip to content

Commit c5e7f32

Browse files
committed
Integrate the Data.Bitstream logic.
1 parent 663b070 commit c5e7f32

File tree

9 files changed

+464
-347
lines changed

9 files changed

+464
-347
lines changed

cabal.project

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
packages: *.cabal ../data-bitcode-llvm/*.cabal

data-bitcode.cabal

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
-- This file has been generated from package.yaml by hpack version 0.14.1.
2-
--
3-
-- see: https://github.com/sol/hpack
4-
51
name: data-bitcode
62
version: 0.1.0.0
73
synopsis: bitcode reader and writer
@@ -35,27 +31,62 @@ library
3531
Data.BitCode.Reader.FromBits
3632
Data.BitCode.Reader.Monad
3733
Data.BitCode.Writer
38-
Data.BitCode.Writer.Combinators
3934
Data.BitCode.Writer.Monad
4035
Data.BitCode.Writer.ToBits
4136
build-depends:
42-
base >= 4.7 && < 5
37+
base >= 4.10 && <4.11
38+
, pretty
39+
, bytestring
40+
, binary
41+
, containers
42+
, base16-bytestring
43+
, transformers
44+
default-language: Haskell2010
45+
46+
test-suite spec
47+
main-is: Tasty.hs
48+
hs-source-dirs: test
49+
other-modules: BitcodeSpec
50+
ghc-options: -Wall -threaded
51+
type: exitcode-stdio-1.0
52+
build-depends: base
53+
, tasty
54+
, tasty-discover
55+
, tasty-hspec
56+
, process
57+
, filepath
58+
, data-bitcode
59+
-- , data-bitcode-llvm
60+
-- , data-bitcode-llvm
61+
default-language: Haskell2010
62+
63+
benchmark writer
64+
type: exitcode-stdio-1.0
65+
main-is: Bench.hs
66+
hs-source-dirs:
67+
bench/src
68+
ghc-options: -main-is Bench
69+
build-depends:
70+
base >= 4.10 && < 5
4371
, pretty >= 1.1
4472
, bytestring >= 0.10
4573
, binary >= 0.8
4674
, containers >= 0.5
4775
, base16-bytestring
48-
, transformers
76+
, criterion
77+
, data-bitcode
78+
other-modules:
79+
Bench
4980
default-language: Haskell2010
5081

51-
benchmark writer
82+
benchmark bitcode
5283
type: exitcode-stdio-1.0
5384
main-is: Bench.hs
5485
hs-source-dirs:
5586
bench/src
5687
ghc-options: -main-is Bench
5788
build-depends:
58-
base >= 4.7 && < 5
89+
base >= 4.10 && < 5
5990
, pretty >= 1.1
6091
, bytestring >= 0.10
6192
, binary >= 0.8
@@ -64,5 +95,4 @@ benchmark writer
6495
, criterion
6596
, data-bitcode
6697
other-modules:
67-
Bench
6898
default-language: Haskell2010

default.nix

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

package.yaml

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

src/Data/BitCode/Writer.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ import Data.BitCode
66
import Data.BitCode.Writer.Monad as M
77
import Data.BitCode.Writer.ToBits
88

9+
import Data.Word (Word64)
10+
911
writeFile :: FilePath -> [BitCode] -> IO ()
1012
writeFile fp = M.writeFile fp . emitTopLevel
1113

12-
emitTopLevel :: [BitCode] -> BitCodeWriter ()
13-
emitTopLevel = mapM_ (emit . (2::Int,))
14+
emitTopLevel :: [BitCode] -> Bitstream ()
15+
emitTopLevel = mapM_ (emit . (2::Word64,))

src/Data/BitCode/Writer/Combinators.hs

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

0 commit comments

Comments
 (0)