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:
Peter Huene
2021-04-01 19:32:15 -07:00
parent 4ad0099da4
commit 0ddfe97a09
17 changed files with 194 additions and 186 deletions

View File

@@ -64,7 +64,7 @@ use crate::binemit::{CodeInfo, CodeOffset, StackMap};
use crate::ir::condcodes::IntCC;
use crate::ir::{Function, SourceLoc, StackSlot, Type, ValueLabel};
use crate::result::CodegenResult;
use crate::settings::Flags;
use crate::settings::{self, Flags};
use crate::value_label::ValueLabelsRanges;
use alloc::boxed::Box;
use alloc::vec::Vec;
@@ -368,11 +368,8 @@ pub trait MachBackend {
/// Return flags for this backend.
fn flags(&self) -> &Flags;
/// Get the enabled ISA-dependent flags that were used to make this trait object.
fn enabled_isa_flags(&self) -> Vec<String>;
/// Determines if the given ISA-dependent flag is enabled.
fn is_flag_enabled(&self, flag: &str) -> bool;
/// Get the ISA-dependent flag values that were used to make this trait object.
fn isa_flags(&self) -> Vec<settings::Value>;
/// Hashes all flags, both ISA-independent and ISA-dependent, into the specified hasher.
fn hash_all_flags(&self, hasher: &mut dyn Hasher);