rust/compiler/rustc_interface
bors a1411de9de Auto merge of #86267 - ZuseZ4:master, r=nagisa
Allow loading of llvm plugins on nightly

Based on a discussion in  #82734 / with `@wsmoses.`
Mainly moves [this](0149bc4e7e) behind a -Z flag, so it can only be used on nightly,
as requested by `@nagisa` in https://github.com/rust-lang/rust/issues/82734#issuecomment-835863940

This change allows loading of llvm plugins like Enzyme.
Right now it also requires a shared library LLVM build of rustc for symbol resolution.

```rust
// test.rs
extern { fn __enzyme_autodiff(_: usize, ...) -> f64; }

fn square(x : f64) -> f64 {
   return x * x;
}

fn main() {
   unsafe {
      println!("Hello, world {} {}!", square(3.0), __enzyme_autodiff(square as usize, 3.0));
   }
}
```
```
./rustc test.rs -Z llvm-plugins="./LLVMEnzyme-12.so" -C passes="enzyme"
./test
Hello, world 9 6!
```

I will try to figure out how to simplify the usage and get this into stable in a later iteration,
but having this on nightly will already help testing further steps.
2021-06-26 19:20:41 +00:00
..
src Auto merge of #86267 - ZuseZ4:master, r=nagisa 2021-06-26 19:20:41 +00:00
Cargo.toml Use tempfile 2021-04-23 15:33:57 -07:00