compiler_builtins.rs (4f2c0a4acffbec01079c28f839422e64ddeff004) compiler_builtins.rs (cb7d9defdafba4c1d463a09c9b09876066f81ee4)
1// SPDX-License-Identifier: GPL-2.0
2
3//! Our own `compiler_builtins`.
4//!
5//! Rust provides [`compiler_builtins`] as a port of LLVM's [`compiler-rt`].
6//! Since we do not need the vast majority of them, we avoid the dependency
7//! by providing this file.
8//!

--- 14 unchanged lines hidden (view full) ---

23#![compiler_builtins]
24#![no_builtins]
25#![no_std]
26
27macro_rules! define_panicking_intrinsics(
28 ($reason: tt, { $($ident: ident, )* }) => {
29 $(
30 #[doc(hidden)]
1// SPDX-License-Identifier: GPL-2.0
2
3//! Our own `compiler_builtins`.
4//!
5//! Rust provides [`compiler_builtins`] as a port of LLVM's [`compiler-rt`].
6//! Since we do not need the vast majority of them, we avoid the dependency
7//! by providing this file.
8//!

--- 14 unchanged lines hidden (view full) ---

23#![compiler_builtins]
24#![no_builtins]
25#![no_std]
26
27macro_rules! define_panicking_intrinsics(
28 ($reason: tt, { $($ident: ident, )* }) => {
29 $(
30 #[doc(hidden)]
31 #[no_mangle]
31 #[export_name = concat!("__rust", stringify!($ident))]
32 pub extern "C" fn $ident() {
33 panic!($reason);
34 }
35 )*
36 }
37);
38
39define_panicking_intrinsics!("`f32` should not be used", {

--- 16 unchanged lines hidden (view full) ---

56
57define_panicking_intrinsics!("`u128` should not be used", {
58 __ashlti3,
59 __lshrti3,
60 __udivmodti4,
61 __udivti3,
62 __umodti3,
63});
32 pub extern "C" fn $ident() {
33 panic!($reason);
34 }
35 )*
36 }
37);
38
39define_panicking_intrinsics!("`f32` should not be used", {

--- 16 unchanged lines hidden (view full) ---

56
57define_panicking_intrinsics!("`u128` should not be used", {
58 __ashlti3,
59 __lshrti3,
60 __udivmodti4,
61 __udivti3,
62 __umodti3,
63});
64
65// NOTE: if you are adding a new intrinsic here, you should also add it to
66// `redirect-intrinsics` in `rust/Makefile`.