[Linux-kernel-mentees] [PATCH 00/30] cocci: Add macrodecl attributes to C and SmPL ASTs

Jaskaran Singh jaskaransingh7654321 at gmail.com
Sun May 24 17:19:05 UTC 2020


This patch series aims to add macrodecl attributes to C and SmPL ASTs,
and match them in C source code. This is a continuation of the series
"cocci: Improve C parsing of attributes"[1].

Two test cases are included:

- detect_macrodecl_attr: Test case to detect a macrodecl attribute.

- remove_macrodecl_attr: Test case to remove a macrodecl attribute as per the
  given SmPL.

[1]https://www.mail-archive.com/cocci@systeme.lip6.fr/msg07133.html

Jaskaran Singh (30):
      parsing_cocci: ast0_cocci: Add Macrodecl attributes
      parsing_cocci: parser: Parse Macrodecl attributes
      parsing_cocci: visitor_ast0: Visit Macrodecl attributes
      parsing_cocci: unparse_ast0: Reflect Macrodecl attributes
      parsing_cocci: index: Reflect Macrodecl attributes
      parsing_cocci: iso_pattern: Reflect Macrodecl attributes
      parsing_cocci: type_infer: Reflect Macrodecl attributes
      parsing_cocci: arity: Reflect Macrodecl attributes
      parsing_cocci: check_meta: Reflect Macrodecl attributes
      parsing_cocci: compute_lines: Reflect Macrodecl attributes
      parsing_cocci: context_neg: Reflect Macrodecl attributes
      parsing_cocci: single_statement: Reflect Macrodecl attributes
      parsing_cocci: ast_cocci: Reflect Macrodecl attributes
      parsing_cocci: visitor_ast: Reflect Macrodecl attributes
      parsing_cocci: pretty_print_cocci: Reflect Macrodecl attributes
      parsing_cocci: disjdistr: Reflect Macrodecl attributes
      parsing_cocci: adjust_pragmas: Reflect Macrodecl attributes
      parsing_cocci: unify_ast: Reflect Macrodecl attributes
      parsing_cocci: ast0toast: Reflect Macrodecl attributes
      parsing_c: ast_c: Add Macrodecl attributes
      parsing_c: parser_c: Reflect Macrodecl attributes
      parsing_c: visitor_c: Reflect Macrodecl attributes
      parsing_c: pretty_print_c: Reflect Macrodecl attributes
      parsing_c: unparse_cocci: Reflect Macrodecl attributes
      engine: check_exhaustive_pattern: Reflect Macrodecl attributes
      engine: cocci_vs_c: Match Macrodecl attributes
      ocaml: coccilib: Reflect Macrodecl attributes
      tools: spgen: Reflect Macrodecl attributes
      tests: Add test case to remove macrodecl attributes
      tests: Add test case to detect a macrodecl attribute

 engine/check_exhaustive_pattern.ml       |    4 ++--
 engine/cocci_vs_c.ml                     |   23 +++++++++++++----------
 ocaml/coccilib.mli                       |    8 +++++---
 parsing_c/ast_c.ml                       |    3 ++-
 parsing_c/ast_c.mli                      |    4 +++-
 parsing_c/parser_c.mly                   |   23 ++++++++++++++++-------
 parsing_c/pretty_print_c.ml              |    7 ++++---
 parsing_c/unparse_cocci.ml               |    7 +++++--
 parsing_c/visitor_c.ml                   |    6 ++++--
 parsing_cocci/adjust_pragmas.ml          |   12 ++++++------
 parsing_cocci/arity.ml                   |    5 +++--
 parsing_cocci/ast0_cocci.ml              |    3 ++-
 parsing_cocci/ast0_cocci.mli             |    3 ++-
 parsing_cocci/ast0toast.ml               |    5 +++--
 parsing_cocci/ast_cocci.ml               |    3 ++-
 parsing_cocci/ast_cocci.mli              |    3 ++-
 parsing_cocci/check_meta.ml              |    3 ++-
 parsing_cocci/compute_lines.ml           |    7 ++++---
 parsing_cocci/context_neg.ml             |    6 +++---
 parsing_cocci/disjdistr.ml               |    4 ++--
 parsing_cocci/index.ml                   |    2 +-
 parsing_cocci/iso_pattern.ml             |    9 ++++++---
 parsing_cocci/parser_cocci_menhir.mly    |    8 ++++----
 parsing_cocci/pretty_print_cocci.ml      |    7 +++++--
 parsing_cocci/single_statement.ml        |    6 +++---
 parsing_cocci/type_infer.ml              |    2 +-
 parsing_cocci/unify_ast.ml               |    4 ++--
 parsing_cocci/unparse_ast0.ml            |    7 +++++--
 parsing_cocci/visitor_ast.ml             |   10 ++++++----
 parsing_cocci/visitor_ast0.ml            |    7 ++++---
 tests/detect_macrodecl_attr.c            |    5 +++++
 tests/detect_macrodecl_attr.cocci        |   12 ++++++++++++
 tests/detect_macrodecl_attr.res          |    5 +++++
 tests/remove_macrodecl_attr.c            |    3 +++
 tests/remove_macrodecl_attr.cocci        |    8 ++++++++
 tests/remove_macrodecl_attr.res          |    3 +++
 tools/spgen/source/meta_variable.ml      |    2 +-
 tools/spgen/source/position_generator.ml |    4 ++--
 38 files changed, 161 insertions(+), 82 deletions(-)




More information about the Linux-kernel-mentees mailing list