mirror of https://github.com/ARMmbed/mbed-os.git
Toolchain independent noinline
parent
92e4a1faf7
commit
3df42bcfb4
|
|
@ -137,6 +137,27 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/** MBED_NOINLINE
|
||||||
|
* Declare a function that must not be inlined.
|
||||||
|
*
|
||||||
|
* @code
|
||||||
|
* #include "mbed_toolchain.h"
|
||||||
|
*
|
||||||
|
* MBED_NOINLINE void foo() {
|
||||||
|
*
|
||||||
|
* }
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
#ifndef MBED_NOINLINE
|
||||||
|
#if defined(__GNUC__) || defined(__clang__) || defined(__CC_ARM)
|
||||||
|
#define MBED_NOINLINE __attribute__((noinline))
|
||||||
|
#elif defined(__ICCARM__)
|
||||||
|
#define MBED_NOINLINE _Pragma("inline=never")
|
||||||
|
#else
|
||||||
|
#define MBED_NOINLINE
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/** MBED_FORCEINLINE
|
/** MBED_FORCEINLINE
|
||||||
* Declare a function that must always be inlined. Failure to inline
|
* Declare a function that must always be inlined. Failure to inline
|
||||||
* such a function will result in an error.
|
* such a function will result in an error.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue