Added unsafe block to 4.0 FFI calls
@@ -529,6 +529,7 @@ impl Target {
pub fn initialize_lanai(config: &InitializationConfig) {
use llvm_sys::target::{LLVMInitializeLanaiTargetInfo, LLVMInitializeLanaiTarget, LLVMInitializeLanaiTargetMC, LLVMInitializeLanaiAsmPrinter, LLVMInitializeLanaiAsmParser, LLVMInitializeLanaiDisassembler};
+ unsafe {
if config.base {
LLVMInitializeLanaiTarget()
}
@@ -553,11 +554,13 @@ impl Target {
LLVMInitializeLanaiTargetMC()
}
}
+ }
#[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7", feature = "llvm3-8", feature = "llvm3-9")))]
pub fn initialize_riscv(config: &InitializationConfig) {
use llvm_sys::target::{LLVMInitializeRISCVTargetInfo, LLVMInitializeRISCVTarget, LLVMInitializeRISCVTargetMC};
+ unsafe {
if config.base {
LLVMInitializeRISCVTarget()
}
@@ -576,6 +579,7 @@ impl Target {
LLVMInitializeRISCVTargetMC()
}
}
+ }
pub fn initialize_native(config: &InitializationConfig) -> Result<(), String> {
use llvm_sys::target::{LLVM_InitializeNativeTarget, LLVM_InitializeNativeAsmParser, LLVM_InitializeNativeAsmPrinter, LLVM_InitializeNativeDisassembler};
