TheDan64 / inkwell

It's a New Kind of Wrapper for Exposing LLVM (Safely)
https://thedan64.github.io/inkwell/
Apache License 2.0
2.38k stars 229 forks source link

Add build_return variant that accepts BasicValueEnum #401

Closed goatfryed closed 1 year ago

goatfryed commented 1 year ago

Currently, there are two variants. One that accepts a BasicValue and one that accepts a BasicValueEnum array and builds an aggregate return.

This makes it awkward to use in cases where the return value is stored as a BasicValueEnum in between, because there doesn't seem a simple way to get back to the BasicValue accept for matching all value cases.

Maybe you could just add an AsBasicValueRef trait and allow both BasicValue and BasicValueEnum?

goatfryed commented 1 year ago

Sorry, me dumb. 😅 That's actually possible. I just had a mistake and didn't notice the actual silly issue.