Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/angerman/data-bitcode-plugin-env
Data.Bitcode.Plugin playground (nix env)
https://github.com/angerman/data-bitcode-plugin-env
Last synced: 14 days ago
JSON representation
Data.Bitcode.Plugin playground (nix env)
- Host: GitHub
- URL: https://github.com/angerman/data-bitcode-plugin-env
- Owner: angerman
- Created: 2016-12-12T13:34:10.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-12T13:46:40.000Z (about 8 years ago)
- Last Synced: 2024-11-14T02:03:08.991Z (about 2 months ago)
- Language: Nix
- Size: 4.88 KB
- Stars: 2
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A nix-shell environment for Data.BitCode.Plugin
The purpose of this repository is to facilitate the testing of the
ghc plugin that produces bitcode instead of textual ir files.See also the README at [data-bitcode-plugin](https://github.com/angerman/data-bitcode-plugin).
## Running via nix
```
$ nix-shell
```should be sufficient to drop into a nix shell with the patched `ghc`
and the `data-bitcode-plugin` package in the packages database.## Taking the bitcode backend for a spin
Executing `ghc` with the `Data.BitCode.Plugin` plugin
```
[nix-shell]$ ghc examples/HelloWorld.hs -fplugin Data.BitCode.Plugin -fllvm
```
should produce the `examples/HelloWorld` binary via the bitcode
compilation pass.## Breaking (and fixing) the bitcode backend
Simply add more complex modules to the `examples` folder, and try
to compile them as above. If this does not lead to the expected
result, please open a pull request with your module!Fixing the compilation should often only require to look into
[src/Data/BitCode/LLVM/Gen.hs](https://github.com/angerman/data-bitcode-plugin/blob/master/src/Data/BitCode/LLVM/Gen.hs)
in the [data-bitcode-plugin](https://github.com/angerman/data-bitcode-plugin)
package. And comparing it to the current llvm backend in ghc at [compiler/llvmGen/LlvmCodeGen/CodeGen.hs](https://github.com/ghc/ghc/blob/master/compiler/llvmGen/LlvmCodeGen/CodeGen.hs).