bscarlet / llvm-general

Rich LLVM bindings for Haskell (with transfer of LLVM IR to and from C++, detailed compilation pass control, etc.)
http://hackage.haskell.org/package/llvm-general
132 stars 38 forks source link

Fix pattern match failure in decodeM for ConstantStruct of NamedTypeReference type. #81

Closed lambdageek closed 10 years ago

lambdageek commented 10 years ago

example: %struct.ps = type { i32, i32 } @fib.p = private unnamed_addr constant %struct.ps { i32 0, i32 1 }, align 4

lambdageek commented 10 years ago

I'm still learning about how LLVM works, so I'm not sure if there is a more general problem here, or if this (rather narrow) fix is sufficient.

bscarlet commented 10 years ago

Thanks! Hopefully I'll get to this soon.

bscarlet commented 10 years ago

I started looking at this, and it looks like there might be a deeper problem. Your test case fails both ways, I think - both building an AST from a Module and building a Module from an AST.

bscarlet commented 10 years ago

This fix is now up on hackage. Thanks!