The llvm-general-quote package

[Tags:bsd3, library, test]

This package provides a QuasiQuotation for llvm-general.


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.2.0.0
Dependencies array (==0.5.*), base (==4.7.*), bytestring, containers (==0.5.*), haskell-src-meta, llvm-general-pure (>=3.4.3.0), mainland-pretty, mtl (>=2.2.1), split, srcloc, syb, symbol, template-haskell (>=2.7), th-lift [details]
License BSD3
Copyright Timo von Holtz 2014
Author Timo von Holtz <tvh@tvholtz.de>
Maintainer Timo von Holtz <tvh@tvholtz.de>
Stability Unknown
Category Compilers/Interpreters, Code Generation
Home page https://github.com/tvh/llvm-general-quote
Source repository head: git clone git://github.com/tvh/llvm-general-quote.git
Uploaded Tue Oct 14 22:41:42 UTC 2014 by TvH
Distributions NixOS:0.2.0.0
Downloads 458 total (4 in the last 30 days)
Votes
0 []
Status Docs uploaded by user
Build status unknown [no reports yet]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for llvm-general-quote

Readme for llvm-general-quote-0.2.0.0

llvm-general-quote

llvm-general-quote is a quasiquoting-library for llvm-general. It aims to support all language constructs of llvm.

In addtion to this, it supports using mutable variables and control structures instead of pure SSA form. This is translated automatically into SSA through appropriate renaming.

Example:

[lldef|
  define i64 @foo(i64 %start, i64 %end) {
    entry:
      %x = i64 0

    for:
      for i64 %i in %start to %end {
          %x = add i64 %i, %x
      }

    exit:
      ret i64 %x
  }
  |]

this would be transformed into:

define i64 @foo(i64 %start, i64 %end) {
entry:
  br label %for.head

for.head:                      ; preds = %n0, %entry
  %x.12 = phi i64 [ 0, %entry ], [ %x.6, %n0 ]
  %i.4 = phi i64 [ %start, %entry ], [ %i.9, %n0 ]
  %for.cond.3 = icmp slt i64 %i.4, %end
  br i1 %for.cond.3, label %n0, label %for.end

n0:                            ; preds = %for.head
  %x.6 = add i64 %i.4, %x.12
  %i.9 = add nuw nsw i64 %i.4, 1
  br label %for.head

for.end:                       ; preds = %for.head
  ret i64 %x.12
}