mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2024-12-23 20:51:31 +11:00
Generate intrinsic aliases directly
Using the full module structure generated by the intrinsics macro interacts oddly with inlining on some optimization levels, causing a duplicate identical function body to be generated. This doesn't affect performance, but it wastes space, so just declare the alias directly which seems to cause the symbol to be aliased as it should be.
This commit is contained in:
parent
f67b650bb3
commit
b8ef969d92
|
@ -13,9 +13,10 @@ macro_rules! intrinsics_aliases {
|
|||
$($rest:ident)*
|
||||
) => {
|
||||
#[cfg(all(target_arch = "arm", not(feature = "disable-intrinsics")))]
|
||||
intrinsics! {
|
||||
extern $abi fn $alias( $($argname: $ty),* ) -> $ret {
|
||||
$name($($argname),*)
|
||||
mod $alias {
|
||||
#[no_mangle]
|
||||
pub extern $abi fn $alias( $($argname: $ty),* ) -> $ret {
|
||||
super::$name($($argname),*)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,9 +32,10 @@ macro_rules! intrinsics_aliases {
|
|||
$($rest:ident)*
|
||||
) => {
|
||||
#[cfg(all(target_arch = "arm", not(feature = "disable-intrinsics")))]
|
||||
intrinsics! {
|
||||
mod $alias {
|
||||
#[no_mangle]
|
||||
unsafe extern $abi fn $alias( $($argname: $ty),* ) -> $ret {
|
||||
$name($($argname),*)
|
||||
super::$name($($argname),*)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue