Closed not-matthias closed 1 year ago
I don't believe the C API supports custom passes. Has the changed?
Not sure how we'd integrate with the crate you linked to since they have a dependency on inkwell. Hmm. This is probably better suited as a plugin ontop of inkwell
Just checked myself and it seems the C API doesn't support this. And since I now require some functionality from C++ passes, I kinda have to create a wrapper around opt
.
Not sure if the C API will ever support something like this, but I'm closing it until then.
Is your feature request related to a problem? Please describe. I'm working on a project where I need to write some custom LLVM passes. Afaik,
inkwell
only supports adding and running LLVM based passes. I don't want to runopt
withstd::process::Command
.Describe the solution you'd like
It would be neat if I could just define a pass in Rust and add it to the pass manager. This could be combined with llvm-plugin-rs which already supports creating custom passes with Rust. For example, I want to do something like that:
Describe possible drawbacks to your solution
Can't think of any.
Describe alternatives you've considered
There are two alternatives:
opt
where you pass the compiled plugin