[clang] Support `guarded_by` attribute and related attributes inside C structs and support late parsing them (PR #95455)

Pierre d'Herbemont via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 18 21:55:18 PDT 2024


================
@@ -1,10 +1,11 @@
 // RUN: %clang_cc1 -fsyntax-only -verify -Wthread-safety -Wthread-safety-beta %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wthread-safety -Wthread-safety-beta -fexperimental-late-parse-attributes -DLATE_PARSING %s
 
 #define LOCKABLE            __attribute__ ((lockable))
 #define SCOPED_LOCKABLE     __attribute__ ((scoped_lockable))
-#define GUARDED_BY(x)       __attribute__ ((guarded_by(x)))
+#define GUARDED_BY(...)     __attribute__ ((guarded_by(__VA_ARGS__)))
----------------
pdherbemont wrote:

To be able to test passing multiple arguments. On the previous iteration of the patch the attribute was parsed manually and we needed to make sure all cases where covered.

https://github.com/llvm/llvm-project/pull/95455


More information about the cfe-commits mailing list