[haskell-llvm] [Haskell-cafe] LLVM, type-level?
    Henning Thielemann 
    lemming at henning-thielemann.de
       
    Wed Dec  8 11:13:38 EST 2010
    
    
  
On Wed, 8 Dec 2010, Lally Singh wrote:
> On Wed, Dec 8, 2010 at 9:15 AM, Lally Singh <lally.singh at gmail.com> wrote:
>>
>> I didn't figure out how to add an instance for GetElementPtr within my
>> module -- I think it was because IsIndexable.getArg and getIxList
>> weren't exported -- perhaps it should be in the llvm.  But, changing
>> the type to Ptr(Array D0 Word8) made it work.
>
> Ugh, it compiled, but LLVm didn't like the generated code when I ran lli.
>
> The only way to get this to work is by modifying the llvm package, it
> seems.  I think I'll have to modify GEP in general to make it work for
> structure declarations.
No hacks please! :-) Ptr Word8 can be used for unbounded arrays with 
element type Word8.
  getElementPtr (ptrReg::Value (Ptr Word8)) (i::Int32, ())
should work. You cannot define custom types, because they would not have 
an equivalent in LLVM. As far as I have used 'llvm', the package provides 
all LLVM types and type constructors.
    
    
More information about the Haskell-llvm
mailing list