
31 May
2010
31 May
'10
6:02 p.m.
For instance, the LLVM.FFI.BitReader module has some functions that'll get you a ModuleRef from some bitcode.
getBitcodeModuleInContext :: ContextRef -> MemoryBufferRef -> Ptr ModuleRef -> Ptr CString -> IO Bool type ModuleRef = Ptr Module data Module I'm confused how this works. How does one get a Ptr ModuleRef to call this function? Module is not Storable, so you can't use alloca or malloc. And I don't see any functions in the library that returns a Ptr ModuleRef. What am I missing? (Sorry, I lack experience with Foreign.Ptr.) To get started, I want to make a function that reads an llvm object file and returns a ModuleRef: readObj :: FilePath -> IO ModuleRef -Tom