(sess: &Session)
| 17 | static INIT: Once = Once::new(); |
| 18 | |
| 19 | pub(crate) fn init(sess: &Session) { |
| 20 | unsafe { |
| 21 | // Before we touch LLVM, make sure that multithreading is enabled. |
| 22 | INIT.call_once(|| { |
| 23 | if llvm::LLVMStartMultithreaded() != 1 { |
| 24 | // use an extra bool to make sure that all future usage of LLVM |
| 25 | // cannot proceed despite the Once not running more than once. |
| 26 | POISONED.store(true, Ordering::SeqCst); |
| 27 | } |
| 28 | |
| 29 | configure_llvm(sess); |
| 30 | }); |
| 31 | |
| 32 | if POISONED.load(Ordering::SeqCst) { |
| 33 | bug!("couldn't enable multi-threaded LLVM"); |
| 34 | } |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | unsafe fn configure_llvm(sess: &Session) { |
| 39 | // TODO(RDambrosio016): We override the meaning of llvm-args to pass our own nvvm args, |
no test coverage detected