Skip to content

Commit

Permalink
Expose wasmer::LLVMOptLevel
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster128 committed Dec 14, 2020
1 parent 44fb619 commit a1da5e7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ pub use wasmer_compiler_singlepass::Singlepass;
pub use wasmer_compiler_cranelift::{Cranelift, CraneliftOptLevel};

#[cfg(feature = "llvm")]
pub use wasmer_compiler_llvm::LLVM;
pub use wasmer_compiler_llvm::{LLVMOptLevel, LLVM};

#[cfg(feature = "jit")]
pub use wasmer_engine_jit::{JITArtifact, JITEngine, JIT};
Expand Down
8 changes: 4 additions & 4 deletions lib/compiler-llvm/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use inkwell::targets::{
CodeModel, InitializationConfig, RelocMode, Target as InkwellTarget, TargetMachine,
TargetTriple,
};
use inkwell::OptimizationLevel;
pub use inkwell::OptimizationLevel as LLVMOptLevel;
use itertools::Itertools;
use std::fmt::Debug;
use std::sync::Arc;
Expand Down Expand Up @@ -41,7 +41,7 @@ pub trait LLVMCallbacks: Debug + Send + Sync {
pub struct LLVM {
pub(crate) enable_nan_canonicalization: bool,
pub(crate) enable_verifier: bool,
pub(crate) opt_level: OptimizationLevel,
pub(crate) opt_level: LLVMOptLevel,
is_pic: bool,
pub(crate) callbacks: Option<Arc<dyn LLVMCallbacks>>,
/// The middleware chain.
Expand All @@ -55,7 +55,7 @@ impl LLVM {
Self {
enable_nan_canonicalization: false,
enable_verifier: false,
opt_level: OptimizationLevel::Aggressive,
opt_level: LLVMOptLevel::Aggressive,
is_pic: false,
callbacks: None,
middlewares: vec![],
Expand All @@ -72,7 +72,7 @@ impl LLVM {
}

/// The optimization levels when optimizing the IR.
pub fn opt_level(&mut self, opt_level: OptimizationLevel) -> &mut Self {
pub fn opt_level(&mut self, opt_level: LLVMOptLevel) -> &mut Self {
self.opt_level = opt_level;
self
}
Expand Down
4 changes: 3 additions & 1 deletion lib/compiler-llvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ mod trampoline;
mod translator;

pub use crate::compiler::LLVMCompiler;
pub use crate::config::{CompiledKind, InkwellMemoryBuffer, InkwellModule, LLVMCallbacks, LLVM};
pub use crate::config::{
CompiledKind, InkwellMemoryBuffer, InkwellModule, LLVMCallbacks, LLVMOptLevel, LLVM,
};

0 comments on commit a1da5e7

Please sign in to comment.