diff options
Diffstat (limited to 'include/qemu/compiler.h')
-rw-r--r-- | include/qemu/compiler.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index 09fc44c..20780e7 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -170,6 +170,17 @@ # define QEMU_NONSTRING #endif +/* + * Forced inlining may be desired to encourage constant propagation + * of function parameters. However, it can also make debugging harder, + * so disable it for a non-optimizing build. + */ +#if defined(__OPTIMIZE__) +#define QEMU_ALWAYS_INLINE __attribute__((always_inline)) +#else +#define QEMU_ALWAYS_INLINE +#endif + /* Implement C11 _Generic via GCC builtins. Example: * * QEMU_GENERIC(x, (float, sinf), (long double, sinl), sin) (x) |