[master] 077ed037c cocci: Help spatch operate on VMODs

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Fri Aug 26 13:01:12 UTC 2022


commit 077ed037ceeab5cdde3a465f8a7f4185bd71bdca
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Fri Aug 26 14:54:14 2022 +0200

    cocci: Help spatch operate on VMODs
    
    Successfully tested with a dummy semantic patch:
    
        @@
        idexpression ctx, caller;
        @@
    
        -CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
        +AN(ctx);
         CHECK_OBJ_NOTNULL(caller, DEBUG_CALLER_MAGIC);
        -AN(caller->sub);
        +assert(caller->sub);
    
    I decided to cram all definitions in the existing vdef.h file to keep
    our relatively simple setup. We can add more macros as we learn what
    coccinelle trips over.
    
    Refs f5b0b201fe29999d5ebc1458b354a7459eed9eac

diff --git a/tools/coccinelle/vdef.h b/tools/coccinelle/vdef.h
index 3cd515d79..ba0248a30 100644
--- a/tools/coccinelle/vdef.h
+++ b/tools/coccinelle/vdef.h
@@ -1,6 +1,13 @@
+/* vdef.h */
 #define v_printflike_(f,a)
 #define v_deprecated_
 #define v_dont_optimize
 #define v_matchproto_(xxx)
 #define v_statevariable_(varname)
 #define v_unused_
+
+/* vrt.h */
+#define VRT_CTX	const struct vrt_ctx *ctx
+
+/* vcc_if.h */
+#define VPFX(a)	vmod_##a


More information about the varnish-commit mailing list