Refactor calling convention settings. (#304)
Add a calling-convention setting to the `Flags` used as part of the `TargetIsa`. This allows Cretonne code that generates calls to use the correct convention, such as when emitting libcalls during legalization or when the wasm frontend is decoding functions. This setting can be overridden per-function. This also adds "fast", "cold", and "fastcall" conventions, with "fast" as the new default. Note that "fast" and "cold" are not intended to be ABI-compatible across Cretonne versions. This will also ensure Windows users will get an `unimplemented!` rather than silent calling-convention mismatches, which reflects the fact that Windows calling conventions are not yet implemented. This also renames SpiderWASM, which isn't camel-case, to Baldrdash, which is, and which is also a more relevant name.
This commit is contained in:
@@ -25,6 +25,7 @@ use isa::TargetIsa;
|
||||
use std::fmt;
|
||||
use std::result;
|
||||
use std::vec::Vec;
|
||||
use std::str;
|
||||
|
||||
/// A string-based configurator for settings groups.
|
||||
///
|
||||
@@ -360,6 +361,7 @@ mod tests {
|
||||
opt_level = \"default\"\n\
|
||||
enable_verifier = true\n\
|
||||
is_64bit = false\n\
|
||||
call_conv = \"fast\"\n\
|
||||
is_pic = false\n\
|
||||
return_at_end = false\n\
|
||||
avoid_div_traps = false\n\
|
||||
@@ -367,12 +369,12 @@ mod tests {
|
||||
enable_float = true\n\
|
||||
enable_simd = true\n\
|
||||
enable_atomics = true\n\
|
||||
spiderwasm_prologue_words = 0\n\
|
||||
baldrdash_prologue_words = 0\n\
|
||||
allones_funcaddrs = false\n"
|
||||
);
|
||||
assert_eq!(f.opt_level(), super::OptLevel::Default);
|
||||
assert_eq!(f.enable_simd(), true);
|
||||
assert_eq!(f.spiderwasm_prologue_words(), 0);
|
||||
assert_eq!(f.baldrdash_prologue_words(), 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user