fix(wasmtime):Config methods should be idempotent (#4252)
This commit refactored `Config` to use a seperate `CompilerConfig` field instead of operating on `CompilerBuilder` directly to make all its methods idempotent. Fixes #4189
This commit is contained in:
@@ -9,7 +9,6 @@ use cranelift_codegen::settings::{self, Configurable, SetError};
|
||||
use std::fmt;
|
||||
use wasmtime_environ::{CompilerBuilder, Setting, SettingKind};
|
||||
|
||||
#[derive(Clone)]
|
||||
struct Builder {
|
||||
flags: settings::Builder,
|
||||
isa_flags: isa::Builder,
|
||||
@@ -55,10 +54,6 @@ impl CompilerBuilder for Builder {
|
||||
self.isa_flags.triple()
|
||||
}
|
||||
|
||||
fn clone(&self) -> Box<dyn CompilerBuilder> {
|
||||
Box::new(Clone::clone(self))
|
||||
}
|
||||
|
||||
fn target(&mut self, target: target_lexicon::Triple) -> Result<()> {
|
||||
self.isa_flags = isa::lookup(target)?;
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user