项目作者: angerman

项目描述 :
Data.BitCode.LLVM
高级语言: Haskell
项目地址: git://github.com/angerman/data-bitcode-llvm.git
创建时间: 2016-08-06T00:29:13Z
项目社区:https://github.com/angerman/data-bitcode-llvm

开源协议:Other

下载


Data.BitCode.LLVM

A module to produce bitcode from llvm module descriptions.

TODO

High prio

  • Extend the call instruction to carry the symbol, signature
    1. and calling conv, the call is performed with, and verify
    2. that the symbols type matches the signature; and calling conv
    3. if symbol is a Function Symbol. If Symbol is a reference
    4. ensure that the signature matches. (Data.BitCode.LLVM should
    5. automatically insert the required ptr cast if the symbol does
    6. not match).
    7. Also error if neither a Reference with matching signature nor
    8. a Function. I don't think calling anything else makes any
    9. sense?
  • Drop the stupid Type first item from the instruction records.
    1. This should be computed using `instTy`.
  • Make instTy work for getElementPointer.
  • Write tests to verify that instTy works as expected.
  • Verify, e.g. in mkInstRec for Call (e.g. everywhere where we
    1. do not use `instTy` that the type we encode matches the one
    2. we should expect.
  • Fix getValue. We currently assume that we have no fwd references.
    1. And hence can always load the value, but llvm does not work that
    2. way for fwd references. There the value and type are encoded after
    3. each other (ValueId, TypeId). If it's non fwd reference, it's
    4. just ValueId. (see getValueTypePair in BitCodeReader). Similarly this
    5. is required to support fwd references in ToBitCode.
  • Collapse constants.

General

  • Stop handrolling your monads. (Use transformers, and derive!)
  • Better error reporting (e.g. see preliminaries in Data.BitCode.LLVM.Util)
    1. Maybe using `ExceptT` to give good hints as to what faild?
  • More type verification. (E.g. let’s try to make sure you
    1. just can not construct invalid code)