Coccinelle Archive on lore.kernel.org
 help / color / Atom feed
From: Jaskaran Singh <jaskaran.singh@collabora.com>
To: cocci@systeme.lip6.fr
Subject: [Cocci] [PATCH 12/43] engine: cocci_vs_c: Reflect MetaAttributeVal
Date: Sun, 26 Jul 2020 18:21:10 +0530
Message-ID: <20200726125141.17787-13-jaskaran.singh@collabora.com> (raw)
In-Reply-To: <20200726125141.17787-1-jaskaran.singh@collabora.com>

MetaAttributeVal is added to the C AST. Reflect these changes in
cocci_vs_c.ml.

Signed-off-by: Jaskaran Singh <jaskaran.singh@collabora.com>
---
 engine/cocci_vs_c.ml        | 8 ++++++--
 parsing_c/lib_parsing_c.ml  | 3 +++
 parsing_c/lib_parsing_c.mli | 3 +++
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/engine/cocci_vs_c.ml b/engine/cocci_vs_c.ml
index cba6c8d01..ed91a4785 100644
--- a/engine/cocci_vs_c.ml
+++ b/engine/cocci_vs_c.ml
@@ -229,6 +229,8 @@ let equal_metavarval valu valu' =
 
   | Ast_c.MetaFmtVal a, Ast_c.MetaFmtVal b ->
       Lib_parsing_c.al_string_format a = Lib_parsing_c.al_string_format b
+  | Ast_c.MetaAttributeVal a, Ast_c.MetaAttributeVal b ->
+      Lib_parsing_c.al_attribute a = Lib_parsing_c.al_attribute b
   | Ast_c.MetaFragListVal a, Ast_c.MetaFragListVal b ->
       Lib_parsing_c.al_string_fragments a =
       Lib_parsing_c.al_string_fragments b
@@ -287,7 +289,7 @@ let equal_metavarval valu valu' =
       |B.MetaExprListVal _
       |B.MetaExprVal _|B.MetaLocalFuncVal _|B.MetaFuncVal _|B.MetaIdVal _
       |B.MetaAssignOpVal _ | B.MetaBinaryOpVal _
-      |B.MetaFmtVal _|B.MetaFragListVal _
+      |B.MetaFmtVal _|B.MetaFragListVal _|B.MetaAttributeVal _
     ), _
       -> raise (Impossible 16)
 
@@ -322,6 +324,8 @@ let equal_inh_metavarval valu valu'=
   | Ast_c.MetaFmtVal a, Ast_c.MetaFmtVal b ->
       Lib_parsing_c.al_inh_string_format a =
       Lib_parsing_c.al_inh_string_format b
+  | Ast_c.MetaAttributeVal a, Ast_c.MetaAttributeVal b ->
+      Lib_parsing_c.al_inh_attribute a = Lib_parsing_c.al_inh_attribute b
   | Ast_c.MetaFragListVal a, Ast_c.MetaFragListVal b ->
       Lib_parsing_c.al_inh_string_fragments a =
       Lib_parsing_c.al_inh_string_fragments b
@@ -388,7 +392,7 @@ let equal_inh_metavarval valu valu'=
       |B.MetaExprListVal _
       |B.MetaExprVal _|B.MetaLocalFuncVal _|B.MetaFuncVal _|B.MetaIdVal _
       |B.MetaAssignOpVal _ | B.MetaBinaryOpVal _
-      |B.MetaFmtVal _|B.MetaFragListVal _
+      |B.MetaFmtVal _|B.MetaFragListVal _|B.MetaAttributeVal _
     ), _
       -> raise (Impossible 17)
 
diff --git a/parsing_c/lib_parsing_c.ml b/parsing_c/lib_parsing_c.ml
index 99e43be3b..687833604 100644
--- a/parsing_c/lib_parsing_c.ml
+++ b/parsing_c/lib_parsing_c.ml
@@ -86,6 +86,7 @@ let al_name      x = Visitor_c.vk_name_s      (strip_info_visitor()) x
 let al_string_format x = Visitor_c.vk_string_format_s (strip_info_visitor()) x
 let al_string_fragments x =
   Visitor_c.vk_string_fragments_s (strip_info_visitor()) x
+let al_attribute x = Visitor_c.vk_attribute_s (strip_info_visitor()) x
 
 let al_node      x = Visitor_c.vk_node_s      (strip_info_visitor()) x
 
@@ -147,6 +148,7 @@ let al_inh_string_format x =
   Visitor_c.vk_string_format_s (strip_inh_info_visitor()) x
 let al_inh_string_fragments x =
   Visitor_c.vk_string_fragments_s (strip_inh_info_visitor()) x
+let al_inh_attribute x = Visitor_c.vk_attribute_s (strip_inh_info_visitor()) x
 
 
 
@@ -184,6 +186,7 @@ let semi_al_string_format =
   Visitor_c.vk_string_format_s semi_strip_info_visitor
 let semi_al_string_fragments =
   Visitor_c.vk_string_fragments_s semi_strip_info_visitor
+let semi_al_attribute = Visitor_c.vk_attribute_s semi_strip_info_visitor
 
 let semi_al_program =
   List.map (Visitor_c.vk_toplevel_s semi_strip_info_visitor)
diff --git a/parsing_c/lib_parsing_c.mli b/parsing_c/lib_parsing_c.mli
index d9578f3ca..0e53f9060 100644
--- a/parsing_c/lib_parsing_c.mli
+++ b/parsing_c/lib_parsing_c.mli
@@ -22,6 +22,7 @@ val al_arguments :
 val al_fields : Ast_c.field list -> Ast_c.field list
 val al_name : Ast_c.name -> Ast_c.name
 val al_string_format : Ast_c.string_format -> Ast_c.string_format
+val al_attribute : Ast_c.attribute -> Ast_c.attribute
 val al_string_fragments :
   Ast_c.string_fragment list -> Ast_c.string_fragment list
 val al_node : Control_flow_c.node -> Control_flow_c.node
@@ -44,6 +45,7 @@ val al_inh_arguments :
 val al_inh_string_format : Ast_c.string_format -> Ast_c.string_format
 val al_inh_string_fragments :
   Ast_c.string_fragment list -> Ast_c.string_fragment list
+val al_inh_attribute : Ast_c.attribute -> Ast_c.attribute
 val semi_strip_info_visitor : Visitor_c.visitor_c_s
 val semi_al_expr : Ast_c.expression -> Ast_c.expression
 val semi_al_declaration : Ast_c.declaration -> Ast_c.declaration
@@ -67,6 +69,7 @@ val semi_al_arguments :
 val semi_al_string_format : Ast_c.string_format -> Ast_c.string_format
 val semi_al_string_fragments :
   Ast_c.string_fragment list -> Ast_c.string_fragment list
+val semi_al_attribute : Ast_c.attribute -> Ast_c.attribute
 val semi_al_program : Ast_c.toplevel list -> Ast_c.toplevel list
 val real_strip_info_visitor : 'a -> Visitor_c.visitor_c_s
 val real_al_expr : Ast_c.expression -> Ast_c.expression
-- 
2.21.3

_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

  parent reply index

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-26 12:50 [Cocci] [PATCH 00/43] cocci: Add support for meta attributes to SmPL Jaskaran Singh
2020-07-26 12:50 ` [Cocci] [PATCH 01/43] parsing_cocci: ast0_cocci: Add MetaAttribute & MetaAttributeDecl Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 02/43] parsing_cocci: parser: Parse meta attributes and metaattr decls Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 03/43] parsing_cocci: parse_cocci: Reflect MetaAttribute & MetaAttributeDecl Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 04/43] parsing_cocci: ast_cocci: Add " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 05/43] parsing_cocci: iso_pattern: Reflect " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 06/43] parsing_c: unparse_hrule: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 07/43] parsing_cocci: pretty_print_cocci: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 08/43] ocaml: coccilib: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 09/43] ocaml: yes_prepare_ocamlcocci: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 10/43] parsing_c: ast_c: Add MetaAttributeVal Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 11/43] parsing_c: unparse_hrule: Reflect MetaAttributeVal Jaskaran Singh
2020-07-26 12:51 ` Jaskaran Singh [this message]
2020-07-26 12:51 ` [Cocci] [PATCH 13/43] engine: pattern_c: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 14/43] engine: pretty_print_engine: Add MetaAttributeVal Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 15/43] ocaml: coccilib: Reflect MetaAttributeVal Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 16/43] ocaml: ocamlcocci_aux: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 17/43] ocaml: run_ocamlcocci: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 18/43] python: pycocci_aux: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 19/43] parsing_cocci: visitor_ast0: Reflect MetaAttribute Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 20/43] parsing_cocci: check_meta: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 21/43] parsing_cocci: adjust_pragmas: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 22/43] parsing_cocci: context_neg: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 23/43] parsing_cocci: compute_lines: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 24/43] parsing_cocci: iso_pattern: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 25/43] parsing_cocci: function_prototypes: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 26/43] parsing_cocci: arity: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 27/43] parsing_cocci: unitary_ast0: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 28/43] parsing_cocci: unparse_ast0: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 29/43] parsing_cocci: ast0toast: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 30/43] parsing_cocci: visitor_ast: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 31/43] parsing_cocci: cleanup_rules: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 32/43] parsing_cocci: free_vars: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 33/43] parsing_cocci: get_constants: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 34/43] parsing_cocci: get_constants2: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 35/43] parsing_cocci: index: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 36/43] parsing_cocci: pretty_print_cocci: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 37/43] parsing_cocci: safe_for_multi_decls: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 38/43] parsing_cocci: unify_ast: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 39/43] parsing_c: unparse_cocci: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 40/43] engine: cocci_vs_c: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 41/43] tools: spgen: " Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 42/43] tests: Add test case to match meta attribute Jaskaran Singh
2020-07-26 12:51 ` [Cocci] [PATCH 43/43] tests: Add test case to remove a " Jaskaran Singh
2020-08-01 20:36 ` [Cocci] [PATCH 00/43] cocci: Add support for meta attributes to SmPL Julia Lawall
2020-08-02 12:16   ` Jaskaran Singh

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=20200726125141.17787-13-jaskaran.singh@collabora.com \
    --to=jaskaran.singh@collabora.com \
    --cc=cocci@systeme.lip6.fr \
    /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

Coccinelle Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/cocci/0 cocci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 cocci cocci/ https://lore.kernel.org/cocci \
		cocci@systeme.lip6.fr
	public-inbox-index cocci

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/fr.lip6.systeme.cocci


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git