Dan Kolsoi

Results 260 comments of Dan Kolsoi

It's worth noting that this isn't totally a new issue. We've had the same problem with `get_context` which we tried to solve using a `ContextRef

Actually, now that I'm thinking about it again, a way to fix ContextRef's problem would be to duplicate all of the Context methods onto ContextRef and tweak the lifetimes on...

> I think BasicBlock has nothing to do with Module, since BasicBlock::get_parent() returns the parent FunctionValue yes but BasicBlock::get_parent would have to have module lifetime and/or pointer knowledge to create...

> I think aliased Module lives no longer than original as it derives from FunctionValue/GlobalValue binded to original's lifetime (rather than context): The generic type is no longer helpful once...

I think I've sketched out a fix for this using two lifetimes but I'm considering punting it until 0.2.0 since it'll be a fairly big breaking change

WIP branch: https://github.com/TheDan64/inkwell/compare/module-lifetimes

LLVM 14 is already supported, I'm not really sure why you're running into this. Feature is right here: https://github.com/TheDan64/inkwell/blob/master/Cargo.toml#L31

@seanyoung we'll be releasing a 0.1.0 version in the near future which will include it. There a couple remaining issues outstanding

Good catch, the fn value lifetime should probably be tied to the module not the context

I can't seem to reproduce the segfault in LLVM10, I wonder if something changed in LLVM14? 🤔