summaryrefslogtreecommitdiffstats
path: root/include/qemu/compiler.h
diff options
context:
space:
mode:
authorRichard Henderson2019-09-10 18:02:36 +0200
committerRichard Henderson2019-09-25 19:12:33 +0200
commitc6b716cdc0f993e43b19849df1f1698723132246 (patch)
tree693235b62bc1a0a5febc6284828c3a1fedf577d2 /include/qemu/compiler.h
parentexec: Use TARGET_PAGE_BITS_MIN for TLB flags (diff)
downloadqemu-c6b716cdc0f993e43b19849df1f1698723132246.tar.gz
qemu-c6b716cdc0f993e43b19849df1f1698723132246.tar.xz
qemu-c6b716cdc0f993e43b19849df1f1698723132246.zip
cputlb: Disable __always_inline__ without optimization
This forced inlining can result in missing symbols, which makes a debugging build harder to follow. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include/qemu/compiler.h')
-rw-r--r--include/qemu/compiler.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
index 09fc44cca4..20780e722d 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)