qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PULL 18/19] compiler: introduce QEMU_ANNOTATE
Date: Tue, 26 Sep 2023 18:59:14 +0200	[thread overview]
Message-ID: <20230926165915.738719-19-pbonzini@redhat.com> (raw)
In-Reply-To: <20230926165915.738719-1-pbonzini@redhat.com>

Allow a more shorter syntax when defining wrapper macros for
__attribute__((annotate(...))).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/qemu/compiler.h | 6 ++++++
 include/qemu/osdep.h    | 6 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
index a309f90c768..7fda29b445f 100644
--- a/include/qemu/compiler.h
+++ b/include/qemu/compiler.h
@@ -197,4 +197,10 @@
 #define BUILTIN_SUBCLL_BROKEN
 #endif
 
+#if __has_attribute(annotate)
+#define QEMU_ANNOTATE(x) __attribute__((annotate(x)))
+#else
+#define QEMU_ANNOTATE(x)
+#endif
+
 #endif /* COMPILER_H */
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 2897720facd..e4a4eb2d613 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -185,7 +185,7 @@ extern "C" {
  *   }
  */
 #ifdef __clang__
-#define coroutine_fn __attribute__((__annotate__("coroutine_fn")))
+#define coroutine_fn QEMU_ANNOTATE("coroutine_fn")
 #else
 #define coroutine_fn
 #endif
@@ -195,7 +195,7 @@ extern "C" {
  * but can handle running in non-coroutine context too.
  */
 #ifdef __clang__
-#define coroutine_mixed_fn __attribute__((__annotate__("coroutine_mixed_fn")))
+#define coroutine_mixed_fn QEMU_ANNOTATE("coroutine_mixed_fn")
 #else
 #define coroutine_mixed_fn
 #endif
@@ -224,7 +224,7 @@ extern "C" {
  *   }
  */
 #ifdef __clang__
-#define no_coroutine_fn __attribute__((__annotate__("no_coroutine_fn")))
+#define no_coroutine_fn QEMU_ANNOTATE("no_coroutine_fn")
 #else
 #define no_coroutine_fn
 #endif
-- 
2.41.0



  parent reply	other threads:[~2023-09-26 17:01 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26 16:58 [PULL 00/19] Misc patches for 2023-09-26 Paolo Bonzini
2023-09-26 16:58 ` [PULL 01/19] pc_piix: remove pc-i440fx-1.4 up to pc-i440fx-1.7 Paolo Bonzini
2023-09-26 16:58 ` [PULL 02/19] seabios: remove PCI drivers from bios.bin Paolo Bonzini
2023-09-26 16:58 ` [PULL 03/19] user-exec-stub: remove unused variable Paolo Bonzini
2023-09-26 16:59 ` [PULL 04/19] hw/scsi/scsi-disk: Disallow block sizes smaller than 512 [CVE-2023-42467] Paolo Bonzini
2023-09-26 16:59 ` [PULL 05/19] vl: remove shadowed local variables Paolo Bonzini
2023-09-26 16:59 ` [PULL 06/19] ui/vnc: fix debug output for invalid audio message Paolo Bonzini
2023-09-26 16:59 ` [PULL 07/19] ui/vnc: fix handling of VNC_FEATURE_XVP Paolo Bonzini
2023-09-26 16:59 ` [PULL 08/19] mptsas: avoid shadowed local variables Paolo Bonzini
2023-09-26 16:59 ` [PULL 09/19] pm_smbus: rename variable to avoid shadowing Paolo Bonzini
2023-09-26 16:59 ` [PULL 10/19] m48t59-test: avoid possible overflow on ABS Paolo Bonzini
2023-09-26 16:59 ` [PULL 11/19] target/i386/kvm: eliminate shadowed local variables Paolo Bonzini
2023-09-26 16:59 ` [PULL 12/19] target/i386/cpu: avoid " Paolo Bonzini
2023-09-26 16:59 ` [PULL 13/19] target/i386/translate: " Paolo Bonzini
2023-09-26 16:59 ` [PULL 14/19] target/i386/seg_helper: introduce tss_set_busy Paolo Bonzini
2023-09-26 16:59 ` [PULL 15/19] target/i386/seg_helper: remove shadowed variable Paolo Bonzini
2023-09-26 16:59 ` [PULL 16/19] target/i386/svm_helper: eliminate duplicate local variable Paolo Bonzini
2023-09-26 16:59 ` [PULL 17/19] block: mark mixed functions that can suspend Paolo Bonzini
2023-09-26 16:59 ` Paolo Bonzini [this message]
2023-09-26 16:59 ` [PULL 19/19] audio: remove shadowed locals Paolo Bonzini
2023-09-27 20:13 ` [PULL 00/19] Misc patches for 2023-09-26 Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230926165915.738719-19-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).