Change how flags are stored in serialized modules.
This commit changes how both the shared flags and ISA flags are stored in the serialized module to detect incompatibilities when a serialized module is instantiated. It improves the error reporting when a compiled module has mismatched shared flags.
This commit is contained in:
@@ -9,7 +9,7 @@ use crate::isa::Builder as IsaBuilder;
|
||||
use crate::machinst::{compile, MachBackend, MachCompileResult, TargetIsaAdapter, VCode};
|
||||
use crate::result::CodegenResult;
|
||||
use crate::settings::{self as shared_settings, Flags};
|
||||
use alloc::{borrow::ToOwned, boxed::Box, string::String, vec::Vec};
|
||||
use alloc::{boxed::Box, vec::Vec};
|
||||
use core::hash::{Hash, Hasher};
|
||||
use regalloc::{PrettyPrint, RealRegUniverse, Reg};
|
||||
use target_lexicon::Triple;
|
||||
@@ -85,15 +85,8 @@ impl MachBackend for X64Backend {
|
||||
&self.flags
|
||||
}
|
||||
|
||||
fn enabled_isa_flags(&self) -> Vec<String> {
|
||||
self.x64_flags
|
||||
.iter_enabled()
|
||||
.map(ToOwned::to_owned)
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn is_flag_enabled(&self, flag: &str) -> bool {
|
||||
self.x64_flags.is_enabled(flag)
|
||||
fn isa_flags(&self) -> Vec<shared_settings::Value> {
|
||||
self.x64_flags.iter().collect()
|
||||
}
|
||||
|
||||
fn hash_all_flags(&self, mut hasher: &mut dyn Hasher) {
|
||||
|
||||
Reference in New Issue
Block a user