|
| 1 | +; By default we do not inline core, std, alloc, and solana_program |
| 2 | +; with some exceptions below with #[inline] |
| 3 | + |
| 4 | +#[inline(never)] ^core::.*$ |
| 5 | +#[inline(never)] ^std::.*$ |
| 6 | +#[inline(never)] ^<?alloc::.*$ |
| 7 | +#[inline(never)] ^solana_program::.*$ |
| 8 | + |
| 9 | +; CVT functions |
| 10 | +#[inline(never)] ^([^:]+::)*CVT_.*$ |
| 11 | + |
| 12 | +; Rust memory allocation functions |
| 13 | +#[inline(never)] ^__rust_alloc$ |
| 14 | +#[inline(never)] ^__rust_dealloc$ |
| 15 | +#[inline(never)] ^__rust_alloc_zeroed$ |
| 16 | +#[inline(never)] ^__rg_alloc$ |
| 17 | +#[inline(never)] ^__rg_dealloc$ |
| 18 | +#[inline(never)] ^__rg_oom$ |
| 19 | + |
| 20 | +;; We want to inline wrappers that call the global allocator |
| 21 | +#[inline] ^alloc::alloc::exchange_malloc$ |
| 22 | +;;;#[inline] ^alloc::fmt::format::format_inner$ |
| 23 | + |
| 24 | +; memcpy/memmove/memset/memcmp |
| 25 | +; These functions are wrappers to sol_memcpy_, sol_memmove_, |
| 26 | +; sol_memset_, and sol_memcmp_. These wrappers ensure that sol_* |
| 27 | +; preconditions are satisfied when these functions are called |
| 28 | +; (alignment conditions, non-nullity, etc). Since, we are not interested in |
| 29 | +; verifying the code of the wrappers, we don't inline calls to |
| 30 | +; memcpy, memmove, memset, and memcmp so that we can replace them |
| 31 | +; directly with sol_memcpy_, sol_memmove_, sol_memset_, and |
| 32 | +; sol_memcmp_, respectively. |
| 33 | +#[inline(never)] ^memcpy$ |
| 34 | +#[inline(never)] ^memmove$ |
| 35 | +#[inline(never)] ^memset$ |
| 36 | +#[inline(never)] ^memcmp$ |
| 37 | + |
| 38 | + |
| 39 | +; Compiler-RT: integer arithmetic routines used on platforms that don't provide HW support |
| 40 | +; All the functions are described here |
| 41 | +; https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/builtins/README.txt |
| 42 | +; |
| 43 | +; Starting with sbfv2, the code of compiler-rt library is not included in the final ELF file |
| 44 | +; but in ebpf and sbf did so we make sure that we don't inline those functions. |
| 45 | +; |
| 46 | +; Integral bit manipulation |
| 47 | +#[inline(never)] ^__ashldi3$ |
| 48 | +#[inline(never)] ^__ashlti3$ |
| 49 | +#[inline(never)] ^__ashrdi3$ |
| 50 | +#[inline(never)] ^__ashrti3$ |
| 51 | +#[inline(never)] ^__lshrdi3$ |
| 52 | +#[inline(never)] ^__lshrti3$ |
| 53 | +#[inline(never)] ^__clzsi2$ |
| 54 | +#[inline(never)] ^__clzdi2$ |
| 55 | +#[inline(never)] ^__clzti2$ |
| 56 | +#[inline(never)] ^__ctzsi2$ |
| 57 | +#[inline(never)] ^__ctzdi2$ |
| 58 | +#[inline(never)] ^__ctzti2$ |
| 59 | +#[inline(never)] ^__ffssi2$ |
| 60 | +#[inline(never)] ^__ffsdi2$ |
| 61 | +#[inline(never)] ^__ffsti2$ |
| 62 | +#[inline(never)] ^__paritysi2$ |
| 63 | +#[inline(never)] ^__paritydi2$ |
| 64 | +#[inline(never)] ^__parityti2$ |
| 65 | +#[inline(never)] ^__popcountsi2$ |
| 66 | +#[inline(never)] ^__popcountdi2$ |
| 67 | +#[inline(never)] ^__popcountti2$ |
| 68 | +#[inline(never)] ^__bswapsi2$ |
| 69 | +#[inline(never)] ^__bswapdi2$ |
| 70 | +; integral arithmetic |
| 71 | +#[inline(never)] ^__negdi2$ |
| 72 | +#[inline(never)] ^__negti2$ |
| 73 | +#[inline(never)] ^__muldi3$ |
| 74 | +#[inline(never)] ^__multi3$ |
| 75 | +#[inline(never)] ^__divsi3$ |
| 76 | +#[inline(never)] ^__divdi3$ |
| 77 | +#[inline(never)] ^__divti3$ |
| 78 | +#[inline(never)] ^__udivsi3$ |
| 79 | +#[inline(never)] ^__udivdi3$ |
| 80 | +#[inline(never)] ^__udivti3$ |
| 81 | +#[inline(never)] ^__modsi3$ |
| 82 | +#[inline(never)] ^__moddi3$ |
| 83 | +#[inline(never)] ^__modti3$ |
| 84 | +#[inline(never)] ^__umodsi3$ |
| 85 | +#[inline(never)] ^__umoddi3$ |
| 86 | +#[inline(never)] ^__umodti3$ |
| 87 | +#[inline(never)] ^__udivmoddi4$ |
| 88 | +#[inline(never)] ^__udivmodti4$ |
| 89 | +#[inline(never)] ^__udivmodsi4$ |
| 90 | +#[inline(never)] ^__divmodsi4$ |
| 91 | +#[inline(never)] ^__divmoddi4$ |
| 92 | +#[inline(never)] ^__divmodti4$ |
| 93 | +; floating point arithmetic |
| 94 | +#[inline(never)] ^(compiler_builtins::float::add::)?__adddf3$ |
| 95 | +#[inline(never)] ^__muldf3$ |
| 96 | +#[inline(never)] ^(compiler_builtins::float::div::)?__divdf3$ |
| 97 | +#[inline(never)] ^(compiler_builtins::math::libm::exp::)?exp$ |
| 98 | +#[inline(never)] ^__floatundidf$ |
| 99 | +#[inline(never)] ^__powidf2$ |
| 100 | +#[inline(never)] ^__unorddf2$ |
| 101 | +#[inline(never)] ^__truncdfsf2$ |
| 102 | +#[inline(never)] ^__ltdf2$ |
| 103 | +#[inline(never)] ^__gtdf2$ |
| 104 | +#[inline(never)] ^__fixdfdi$ |
| 105 | +#[inline(never)] ^__gedf2$ |
| 106 | +#[inline(never)] ^__floatsidf$ |
| 107 | +#[inline(never)] ^__subdf3$ |
| 108 | +#[inline(never)] ^__floattidf$ |
| 109 | + |
| 110 | +#[inline(never)] ^.*::fmt$ |
| 111 | + |
| 112 | +;; This is a wrapper so we inline it |
| 113 | +#[inline] ^([^:]+::)*CVT_uninterpreted_usize$ |
| 114 | + |
| 115 | +#[inline] ^solana_program::account_info::AccountInfo::new$ |
| 116 | +#[inline] ^solana_program::account_info::AccountInfo::lamports$ |
| 117 | +#[inline] ^solana_program::account_info::AccountInfo::try_borrow_mut_lamports$ |
| 118 | +#[inline] ^solana_program::account_info::AccountInfo::data_len$ |
| 119 | +#[inline] ^solana_program::account_info::AccountInfo::try_data_len$ |
| 120 | +#[inline] ^solana_program::account_info::AccountInfo::try_borrow_data$ |
| 121 | +#[inline] ^solana_program::account_info::AccountInfo::try_borrow_mut_data$ |
| 122 | +#[inline] ^solana_program::account_info::AccountInfo::data_is_empty$ |
| 123 | +#[inline] ^solana_program::program::invoke_signed$ |
| 124 | +#[inline] ^solana_program::program::invoke$ |
| 125 | +#[inline] ^solana_program::program_pack::Pack::unpack$ |
| 126 | +#[inline] ^solana_program::hash::Hash::new_from_array$ |
| 127 | +#[inline] ^solana_program::sysvar::clock::<impl solana_program::sysvar::Sysvar for solana_program::clock::Clock>::get$ |
| 128 | +#[inline] ^solana_program::poseidon::PoseidonHash::new$ |
| 129 | +#[inline] ^solana_program::account_info::AccountInfo::assign$ |
| 130 | +#[inline] ^solana_program::incinerator::check_id$ |
| 131 | +#[inline] ^solana_program::system_program::check_id$ |
| 132 | +#[inline] ^solana_program::system_program::id$ |
| 133 | +#[inline] ^solana_program::rent::Rent::minimum_balance$ |
| 134 | +#[inline] ^solana_program::sysvar::rent::<impl solana_program::sysvar::Sysvar for solana_program::rent::Rent>::get$ |
| 135 | +#[inline] ^solana_program::instruction::get_stack_height$ |
| 136 | +#[inline] ^solana_program::program::set_return_data$ |
| 137 | + |
| 138 | +#[inline(never)] ^<solana_program::program_error::ProgramError as core::convert::From<u64>>::from$ |
| 139 | + |
| 140 | +#[inline] ^core::result::unwrap_failed$ |
| 141 | +#[inline] ^core::cell::RefCell<T>::borrow(_\d+)?$ |
| 142 | +#[inline] ^core::cell::RefCell<T>::borrow_mut(_\d+)?$ |
| 143 | + |
| 144 | + |
| 145 | +;; Borsh and common functions used by Borsh |
| 146 | +#[inline(never)] ^std::io::error::Error::new(_\d+)?$ |
| 147 | +#[inline(never)] ^borsh::de::unexpected_eof_to_unexpected_length_of_input$ |
| 148 | + |
| 149 | + |
| 150 | +;; We need to inline this function to avoid unsoundness results in |
| 151 | +;; NcnOperatorTicket::seeds and others. |
| 152 | +#[inline] ^<alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter(_\d+)?$ |
| 153 | + |
| 154 | +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 155 | +;; Anchor-specific inlining |
| 156 | +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 157 | + |
| 158 | +;; By default we don't inline anything from anchor. |
| 159 | +#[inline(never)] ^.*anchor_lang.*$ |
| 160 | + |
| 161 | +;; except these functions |
| 162 | + |
| 163 | +#[inline] ^anchor_lang::accounts::account_loader::AccountLoader<T>::load(_[0-9][0-9]*)*$ |
| 164 | +#[inline] ^anchor_lang::accounts::account_loader::AccountLoader<T>::load_mut(_[0-9][0-9]*)*$ |
| 165 | + |
| 166 | +#[inline] ^<anchor_lang::accounts::account::Account<T> as core::clone::Clone>::clone(_[0-9][0-9]*)*$ |
| 167 | +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 168 | +;; try_from and try_from_unchecked might call to deserialize so we need to check case by case |
| 169 | +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 170 | +#[inline] ^anchor_lang::accounts::account_loader::AccountLoader<T>::try_from(_[0-9][0-9]*)*$ |
| 171 | +#[inline] ^anchor_lang::accounts::account_loader::AccountLoader<T>::try_from_unchecked(_[0-9][0-9]*)*$ |
| 172 | +#[inline] ^anchor_lang::accounts::account::Account<T>::try_from_unchecked(_[0-9][0-9]*)*$ |
| 173 | +#[inline] ^anchor_lang::accounts::account::Account<T>::try_from(_[0-9][0-9]*)*$ |
| 174 | +#[inline] ^anchor_lang::accounts::signer::Signer::try_from$ |
| 175 | +#[inline] ^<anchor_lang::accounts::program::Program<T> as core::convert::TryFrom<&solana_program::account_info::AccountInfo>>::try_from$ |
| 176 | +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 177 | + |
| 178 | +#[inline] ^<anchor_lang::accounts::unchecked_account::UncheckedAccount as core::convert::AsRef<solana_program::account_info::AccountInfo>>::as_ref$ |
| 179 | +#[inline] ^<anchor_lang::accounts::unchecked_account::UncheckedAccount as anchor_lang::ToAccountInfos>::to_account_infos$ |
| 180 | + |
| 181 | +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 182 | +;;; These are needed to include the code for key() |
| 183 | +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 184 | +#[inline] ^<anchor_lang::accounts::unchecked_account::UncheckedAccount as anchor_lang::Key>::key$ |
| 185 | +#[inline] ^<solana_program::pubkey::Pubkey as anchor_lang::Key>::key$ |
| 186 | +#[inline] ^.*::ZeroCopyAccessor<solana_program::pubkey::Pubkey>>::get$ |
| 187 | +#[inline] ^anchor_lang::accounts::account_info::<impl anchor_lang::Key for solana_program::account_info::AccountInfo>::key$ |
| 188 | + |
| 189 | +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 190 | +;;; These do conversion between error codes |
| 191 | +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 192 | +#[inline] ^<anchor_lang::error::Error as core::convert::From<anchor_lang::error::AnchorError>>::from$ |
| 193 | +#[inline] ^<anchor_lang::error::Error as core::convert::From<anchor_lang::error::ErrorCode>>::from$ |
| 194 | +#[inline] ^<anchor_lang::error::Error as core::convert::From<solana_program::program_error::ProgramError>>::from$ |
| 195 | +#[inline] ^anchor_lang::error::<impl core::convert::From<anchor_lang::error::ErrorCode> for u32>::from$ |
| 196 | +#[inline] ^squads_multisig_program::errors::<impl core::convert::From<squads_multisig_program::errors::MultisigError> for anchor_lang::error::Error>::from$ |
0 commit comments