Adds the libcall_call_conv setting and use it for libcall calls expansion;
This commit is contained in:
committed by
Dan Gohman
parent
c7b4b98cac
commit
d8d3602257
@@ -1,3 +1,5 @@
|
||||
use crate::isa::TargetIsa;
|
||||
use crate::settings::LibcallCallConv;
|
||||
use core::fmt;
|
||||
use core::str;
|
||||
use target_lexicon::{CallingConvention, Triple};
|
||||
@@ -29,6 +31,19 @@ impl CallConv {
|
||||
Ok(CallingConvention::WindowsFastcall) => CallConv::WindowsFastcall,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the calling convention used for libcalls for the given ISA.
|
||||
pub fn for_libcall(isa: &dyn TargetIsa) -> Self {
|
||||
match isa.flags().libcall_call_conv() {
|
||||
LibcallCallConv::IsaDefault => isa.default_call_conv(),
|
||||
LibcallCallConv::Fast => CallConv::Fast,
|
||||
LibcallCallConv::Cold => CallConv::Cold,
|
||||
LibcallCallConv::SystemV => CallConv::SystemV,
|
||||
LibcallCallConv::WindowsFastcall => CallConv::WindowsFastcall,
|
||||
LibcallCallConv::Baldrdash => CallConv::Baldrdash,
|
||||
LibcallCallConv::Probestack => CallConv::Probestack,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for CallConv {
|
||||
|
||||
Reference in New Issue
Block a user