| CARVIEW |
llvm-party: General purpose LLVM bindings
llvm-party is a set of Haskell bindings for LLVM https://llvm.org/. Unlike other current Haskell bindings, it uses an ADT to represent LLVM IR (https://llvm.org/docs/LangRef.html), and so offers two advantages: it handles almost all of the stateful complexities of using the LLVM API to build IR; and it supports moving IR not only from Haskell into LLVM C++ objects, but the other direction - from LLVM C++ into Haskell. This is a fork of llvm-hs, with a major advantage that it's being maintained, for now.
[Skip to Readme]
Modules
[Index] [Quick Jump]
- LLVM
- LLVM.AST
- LLVM.AST.AddrSpace
- LLVM.AST.Attribute
- LLVM.AST.COMDAT
- LLVM.AST.CallingConvention
- LLVM.AST.Constant
- LLVM.AST.DLL
- LLVM.AST.DataLayout
- LLVM.AST.Float
- LLVM.AST.FloatingPointPredicate
- LLVM.AST.FunctionAttribute
- LLVM.AST.Global
- LLVM.AST.InlineAssembly
- LLVM.AST.Instruction
- LLVM.AST.IntegerPredicate
- LLVM.AST.Linkage
- LLVM.AST.Name
- LLVM.AST.Operand
- LLVM.AST.ParameterAttribute
- LLVM.AST.RMWOperation
- LLVM.AST.ThreadLocalStorage
- LLVM.AST.Type
- LLVM.AST.Typed
- LLVM.AST.Visibility
- LLVM.Analysis
- LLVM.CodeGenOpt
- LLVM.CodeModel
- LLVM.CommandLine
- LLVM.Context
- LLVM.DataLayout
- LLVM.Diagnostic
- LLVM.Exception
- LLVM.ExecutionEngine
- LLVM.IRBuilder
- Internal
- LLVM.Internal.Analysis
- LLVM.Internal.Atomicity
- LLVM.Internal.Attribute
- LLVM.Internal.BasicBlock
- LLVM.Internal.CallingConvention
- LLVM.Internal.Coding
- LLVM.Internal.CommandLine
- LLVM.Internal.Constant
- LLVM.Internal.Context
- LLVM.Internal.DataLayout
- LLVM.Internal.DecodeAST
- LLVM.Internal.Diagnostic
- LLVM.Internal.EncodeAST
- LLVM.Internal.ExecutionEngine
- FFI
- LLVM.Internal.FFI.Analysis
- LLVM.Internal.FFI.Assembly
- LLVM.Internal.FFI.Attribute
- LLVM.Internal.FFI.BasicBlock
- LLVM.Internal.FFI.BinaryOperator
- LLVM.Internal.FFI.Bitcode
- LLVM.Internal.FFI.Builder
- LLVM.Internal.FFI.ByteRangeCallback
- LLVM.Internal.FFI.Cleanup
- LLVM.Internal.FFI.CommandLine
- LLVM.Internal.FFI.Constant
- LLVM.Internal.FFI.Context
- LLVM.Internal.FFI.DataLayout
- LLVM.Internal.FFI.DynamicLibrary
- LLVM.Internal.FFI.ExecutionEngine
- LLVM.Internal.FFI.Function
- LLVM.Internal.FFI.GlobalAlias
- LLVM.Internal.FFI.GlobalValue
- LLVM.Internal.FFI.GlobalVariable
- LLVM.Internal.FFI.InlineAssembly
- LLVM.Internal.FFI.Instruction
- LLVM.Internal.FFI.InstructionDefs
- LLVM.Internal.FFI.Iterate
- LLVM.Internal.FFI.LLVMCTypes
- LLVM.Internal.FFI.MemoryBuffer
- LLVM.Internal.FFI.Metadata
- LLVM.Internal.FFI.Module
- LLVM.Internal.FFI.ObjectFile
- LLVM.Internal.FFI.OrcJIT
- LLVM.Internal.FFI.PassManager
- LLVM.Internal.FFI.PtrHierarchy
- LLVM.Internal.FFI.RTDyldMemoryManager
- LLVM.Internal.FFI.RawOStream
- LLVM.Internal.FFI.SMDiagnostic
- LLVM.Internal.FFI.ShortByteString
- LLVM.Internal.FFI.Target
- LLVM.Internal.FFI.Threading
- LLVM.Internal.FFI.Transforms
- LLVM.Internal.FFI.Type
- LLVM.Internal.FFI.User
- LLVM.Internal.FFI.Value
- LLVM.Internal.FastMathFlags
- LLVM.Internal.FloatingPointPredicate
- LLVM.Internal.Function
- LLVM.Internal.Global
- LLVM.Internal.InlineAssembly
- LLVM.Internal.Instruction
- LLVM.Internal.InstructionDefs
- LLVM.Internal.IntegerPredicate
- LLVM.Internal.LibraryFunction
- LLVM.Internal.Linking
- LLVM.Internal.MemoryBuffer
- LLVM.Internal.Metadata
- LLVM.Internal.Module
- LLVM.Internal.ObjectFile
- LLVM.Internal.Operand
- LLVM.Internal.OrcJIT
- LLVM.Internal.PassManager
- LLVM.Internal.RMWOperation
- LLVM.Internal.RawOStream
- LLVM.Internal.String
- LLVM.Internal.TailCallKind
- LLVM.Internal.Target
- LLVM.Internal.Threading
- LLVM.Internal.Type
- LLVM.Internal.Value
- LLVM.Linking
- LLVM.Module
- LLVM.OrcJIT
- LLVM.PassManager
- LLVM.Prelude
- LLVM.Relocation
- LLVM.Target
- LLVM.Threading
- LLVM.Transforms
- LLVM.Triple
- LLVM.AST
Flags
Automatic Flags
| Name | Description | Default |
|---|---|---|
| shared-llvm | link against llvm shared rather than static library | Enabled |
| llvm-with-rtti | assume llvm was built with LLVM_ENABLE_RTTI=ON (default is OFF) | Disabled |
| debug | compile C(++) shims with debug info for ease of troubleshooting | Disabled |
Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info
Downloads
- llvm-party-12.1.1.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
| Versions [RSS] | 12.1.0, 12.1.1 |
|---|---|
| Change log | CHANGELOG.md |
| Dependencies | array (>=0.4.0.0 && <0.6), attoparsec (>=0.13 && <0.15), base (>=4.9 && <5), bytestring (>=0.10 && <0.12), containers (>=0.4.2.1 && <0.7), exceptions (>=0.8 && <0.11), fail (<4.10), mtl (>=2.1.3 && <2.3), template-haskell (>=2.5.0.0 && <2.20), transformers (>=0.3 && <0.6), unordered-containers (>=0.2 && <0.3), utf8-string (>=0.3.7 && <1.1) [details] |
| Tested with | ghc ==8.8.1 |
| License | BSD-3-Clause |
| Copyright | (c) 2013 Benjamin S. Scarlet and Google Inc. |
| Author | Anthony Cowley, Stephen Diehl, Moritz Kiefer <moritz.kiefer@purelyfunctional.org>, Benjamin S. Scarlet |
| Maintainer | Jappie Klooster <hi@jappie.me> |
| Uploaded | by Jappie at 2023-06-27T03:09:28Z |
| Category | Compilers/Interpreters, Code Generation |
| Home page | https://github.com/jappeace/llvm-party/ |
| Bug tracker | https://github.com/jappeace/llvm-party/issues |
| Source repo | head: git clone git://github.com/jappeace/llvm-party.git -b llvm-12 |
| Distributions | |
| Downloads | 243 total (17 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs uploaded by user Build status unknown [no reports yet] |
Readme for llvm-party-12.1.1
[back to package description]llvm-party - Haskell bindings for LLVM
This project aims to provide a relatively complete set of bindings for the LLVM API. If you find that anything is missing please open an issue! We generally try to stay close to the LLVM C++-API so you can consult the LLVM documentation and reuse existing resources.
This is yet another fork of llvm. Specifically llvm-hs/llvm-hs-pure was forked, and smashed together into a single package.
Getting started
If you’ve worked with LLVM before, take a look at the examples in the llvm-hs-examples repo. If not, you can find a translation of the official LLVM tutorial at https://github.com/llvm-hs/llvm-hs-kaleidoscope. There is also a blog series on writing a C compiler with the library. In general, we try to stay very close to the API and AST provided by LLVM itself, so the LLVM language reference is also very useful.
LLVM API Interface
llvm-hs provides an LLVM binding at (roughly) the same level of abstraction
as the official LLVM C API. Because of this, anything you might do with the
LLVM C API, you should expect to be able to do with llvm-hs. In addition,
some things which are not handled in the LLVM C API are supported. For example,
the LLVM C API does not provide any
support for working
with AttributeSet and AttributeList types, but llvm-hs does.
However, the binding to LLVM is only half the story: a lot of advanced
pure-Haskell functionality is built on top of this basic interface in the
llvm-hs-pure module, most notably the monadic
IRBuilder and
ModuleBuilder interfaces
which greatly simplify the task of generating LLVM code from a higher level
abstract syntax. The
llvm-hs-examples
project contains example usage. These high level interfaces are ideal for
implementing the LLVM backend for your code generation project. A good example
is Google's Dex research
language.
LLVM API Coverage and Philosophy
The llvm-hs FFI layer in LLVM/Internal/FFI extends the upstream LLVM C API
adding missing functionality which upstream has not yet exposed from the C++
API. We also provide some improved implementations of buggy or otherwise
problematic functions in the LLVM C API. As the LLVM C API becomes more
complete, we retire our extensions and directly wrap the newly added C API
functions, ensuring our FFI layer is as small as possible.
If you find you need to use some LLVM functionality which is available via the
C++ API but not via the C API or in llvm-hs, please open an issue and
include links to the relevant entities in the LLVM doxygen-generated
documentation.
In general, if it is possible to implement something in Haskell using the LLVM C API primitives, that is preferable to implementing things in the FFI layer and merely exposing them to Haskell as wrapped C or C++ functions.
Contributing
We love all kinds of contributions so please feel free to open issues for missing LLVM features, report & fix bugs or report API inconveniences.
Versioning
Trying to represent the version of LLVM in the version number but also
allowing for version bumps in the bindings themselves while respecting
the PVP can be tricky. Luckily LLVM switched to a
new versioning scheme
of major.0.patch starting from version 4.0. This means that we can
use the last two components for these bindings while the first
component indicates the version of LLVM. A special case are the
versions 3.major.minor that represent bindings to LLVM 3.9. Bindings
to earlier versions are not provided.
How is this related to llvm-general?
This project is a fork of the venerable llvm-general that aims to improve the
public release story, and better provide the interfaces needed for any Haskell
project looking to leverage LLVM. Contributions are encouraged.