[Cocci] [PATCH 27/27] tests: Add test case to check struct endattr allminus

2020-05-31 Thread Jaskaran Singh
Struct end attributes are added to the SmPL and C ASTs. Add a test case to check allminus for struct end attributes. Signed-off-by: Jaskaran Singh --- tests/remove_struct_endattr_allminus.c | 13 + tests/remove_struct_endattr_allminus.cocci | 6 ++ tests

[Cocci] [PATCH 24/27] tools: spgen: Reflect struct end attributes

2020-05-31 Thread Jaskaran Singh
Struct end attributes are added to the SmPL AST. Reflect these changes in spgen. Signed-off-by: Jaskaran Singh --- tools/spgen/source/position_generator.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/spgen/source/position_generator.ml b/tools/spgen/source

[Cocci] [PATCH v4 00/14] cocci: Improve C parsing of attributes

2020-06-05 Thread Jaskaran Singh
tort in the type_name rule parsing_c: parser: Make abstract_declarator pass attributes - Reflect changes from the above build error fix. Jaskaran Singh (14): parsing_c: parse_c: Ignore TMacroAttr and TMacroEndAttr in passed tokens parsing_c: parsing_hacks: Label end attributes corr

[Cocci] [PATCH v4 04/14] parsing_c: parser: Add rule for multiple end attributes

2020-06-05 Thread Jaskaran Singh
There is no rule for productions of multiple end attributes. Add a case similar to that of attribute_list for end attributes. Signed-off-by: Jaskaran Singh --- parsing_c/parser_c.mly | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/parsing_c/parser_c.mly b/parsing_c

[Cocci] [PATCH v4 08/14] parsing_c: parser: Add init_declarator_attrs rule

2020-06-05 Thread Jaskaran Singh
Signed-off-by: Jaskaran Singh --- parsing_c/parser_c.mly | 23 +-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/parsing_c/parser_c.mly b/parsing_c/parser_c.mly index d24ab7b8..9afbd68c 100644 --- a/parsing_c/parser_c.mly +++ b/parsing_c/parser_c.mly @@ -1667,

[Cocci] [PATCH v4 09/14] parsing_c: parser: Add field declaration end attributes production

2020-06-05 Thread Jaskaran Singh
atomic_t load_avg __cacheline_aligned; ... }; Signed-off-by: Jaskaran Singh --- parsing_c/parser_c.mly | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/parsing_c/parser_c.mly b/parsing_c/parser_c.mly index 9afbd68c..5b7e1faf 100644

[Cocci] [PATCH v4 07/14] parsing_c: parser: Add attribute production in spec_qualif_list

2020-06-05 Thread Jaskaran Singh
and casts successfully. Some code examples from Linux v5.5-rc4: kernel/rcu/tree.h: struct rcu_node { ... raw_spinlock_t __private lock; ... }; kernel/sysctl.c: char __user **buffer = (char __user **)buf; Signed-off-by

[Cocci] [PATCH v4 13/14] parsing_c: cpp_token_c: Introduce MACROANNOTATION hint

2020-06-05 Thread Jaskaran Singh
__attribute_name is an attribute, not a comment. Signed-off-by: Jaskaran Singh --- parsing_c/cpp_token_c.ml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/parsing_c/cpp_token_c.ml b/parsing_c/cpp_token_c.ml index 425234e8..0654be26 100644 --- a/parsing_c/cpp_token_c.ml +++ b/parsing_c

[Cocci] [PATCH v4 11/14] parsing_c: parser: Add MacroDecl end attributes production

2020-06-05 Thread Jaskaran Singh
Add a production for macro declaration end attributes. This parses the following C code from Linux v5.6-rc7: arch/x86/kernel/nmi_selftest.c: static DECLARE_BITMAP(nmi_ipi_mask, NR_CPUS) __initdata; Signed-off-by: Jaskaran Singh --- parsing_c/parser_c.mly | 7 --- 1 file changed

[Cocci] [PATCH v4 10/14] parsing_c: parser: Handle struct/union/enum end attributes

2020-06-05 Thread Jaskaran Singh
OP_SCSI_10 = 0x04, MYRS_CMD_OP_SCSI_256= 0x05, MYRS_CMD_OP_IOCTL = 0x20, } __packed; Signed-off-by: Jaskaran Singh --- parsing_c/parser_c.mly | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a

[Cocci] [PATCH v4 05/14] parsing_c: parser: Add expression statement attributes

2020-06-05 Thread Jaskaran Singh
ccessfully: label: attribute; Signed-off-by: Jaskaran Singh --- parsing_c/parser_c.mly | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/parsing_c/parser_c.mly b/parsing_c/parser_c.mly index d259f12a..e4352a61 100644 --- a/parsing_c/parser_c.mly +++ b/parsing_c/pa

[Cocci] [PATCH v4 03/14] parsing_c: parsing_hacks: Commentize attributes before qualif/type

2020-06-05 Thread Jaskaran Singh
ot labeled correctly, leading to C parsing errors. Add a case to commentize attributes before a storage qualifier/type qualifier/type correctly. Signed-off-by: Jaskaran Singh --- parsing_c/parsing_hacks.ml | 33 + 1 file changed, 33 insertions(+) diff --git a

[Cocci] [PATCH v4 06/14] parsing_c: parser: Add rule for optional end attributes

2020-06-05 Thread Jaskaran Singh
A few attribute centric productions cause a lot of duplicate code. Add an 'end_attributes_opt' rule to dispel duplicate code caused by an additional attribute centric productions. Signed-off-by: Jaskaran Singh --- parsing_c/parser_c.mly | 4 1 file changed, 4 insertions(+) di

[Cocci] [PATCH v4 02/14] parsing_c: parsing_hacks: Label end attributes correctly

2020-06-05 Thread Jaskaran Singh
. Add a case to label multiple end attributes correctly. Signed-off-by: Jaskaran Singh --- parsing_c/parsing_hacks.ml | 4 1 file changed, 4 insertions(+) diff --git a/parsing_c/parsing_hacks.ml b/parsing_c/parsing_hacks.ml index 0ee0c6c6..74c3ba60 100644 --- a/parsing_c/parsing_hacks.ml

[Cocci] [PATCH v4 01/14] parsing_c: parse_c: Ignore TMacroAttr and TMacroEndAttr in passed tokens

2020-06-05 Thread Jaskaran Singh
Most cases in parsing_hacks do not consider attributes before or after the token in question. So, do not pass TMacroAttr or TMacroEndAttr tokens to parsing_hacks in the before list. Signed-off-by: Jaskaran Singh --- parsing_c/parse_c.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion

[Cocci] [PATCH v4 12/14] parsing_c: parser: cpp_other end attributes production

2020-06-05 Thread Jaskaran Singh
Add a production for a macro call in the cpp_other rule of Coccinelle's C parser. This parses the following C code from Linux v5.6-rc7 successfully: arch/x86/kernel/irq_64.c: DEFINE_PER_CPU_PAGE_ALIGNED(struct irq_stack, irq_stack_backing_store) __visible; Signed-off-by: Jas

[Cocci] [PATCH v4 14/14] cocci: standard.h: Annotate attributes with MACROANNOTATION

2020-06-05 Thread Jaskaran Singh
Apply the MACROANNOTATION hint to select attributes in standard.h. These hints can be replaced, removed or added by the user as their use case demands. Signed-off-by: Jaskaran Singh --- standard.h | 116 ++--- 1 file changed, 58 insertions(+), 58

Re: [Cocci] [PATCH v4 00/14] cocci: Improve C parsing of attributes

2020-06-05 Thread Jaskaran Singh
On Fri, 2020-06-05 at 19:13 +0530, Jaskaran Singh wrote: > This patch series aims to improve parsing of attributes in C by > Coccinelle's C parser. > > These parsing errors were discovered by running a build of > Coccinelle's > master branch on gitlab to parse the s

[Cocci] [PATCH v4 23/32] parsing_c: type_annoter_c: Reflect Cast attributes

2020-06-06 Thread Jaskaran Singh
Cast attributes are added to the SmPL AST. Reflect these changes in type_annoter_c.ml. Signed-off-by: Jaskaran Singh --- Changes in v4: - Change 't, e, a' to 't, a, e' in the Cast constructor for consistency Changes in v3: Rebase as follows: v3 of "cocci: Ad

[Cocci] [PATCH 0/4] parsing_c: parser: Add end_attributes_opt rule

2020-06-08 Thread Jaskaran Singh
://lore.kernel.org/cocci/20200528122428.4212-1-jaskaransingh7654...@gmail.com/ Jaskaran Singh (4): parsing_c: parser: Add end_attributes_opt rule parsing_c: parser: Use end_attributes_opt in decl2 parsing_c: parser: Use end_attributes_opt in field_declaration parsing_c: parser: Use

[Cocci] [PATCH 1/4] parsing_c: parser: Add end_attributes_opt rule

2020-06-08 Thread Jaskaran Singh
A lot of redundant code is introduced in the C parser due to additional productions for end attributes. Add an end_attributes_opt rule to resolve this. Signed-off-by: Jaskaran Singh --- parsing_c/parser_c.mly | 4 1 file changed, 4 insertions(+) diff --git a/parsing_c/parser_c.mly b

[Cocci] [PATCH 2/4] parsing_c: parser: Use end_attributes_opt in decl2

2020-06-08 Thread Jaskaran Singh
The decl2 rule has redundant code caused by additional productions for end attributes. Use end_attributes_opt to resolve this. Signed-off-by: Jaskaran Singh --- parsing_c/parser_c.mly | 26 ++ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/parsing_c

[Cocci] [PATCH 3/4] parsing_c: parser: Use end_attributes_opt in field_declaration

2020-06-08 Thread Jaskaran Singh
The field_declaration rule has redundant code caused by additional productions for end attributes. Use end_attributes_opt to resolve this. Signed-off-by: Jaskaran Singh --- parsing_c/parser_c.mly | 32 ++-- 1 file changed, 2 insertions(+), 30 deletions(-) diff --git

[Cocci] [PATCH 4/4] parsing_c: parser: Use end_attributes_opt in cpp_other

2020-06-08 Thread Jaskaran Singh
The cpp_other rule has redundant code due to an additional production for end attributes. Use end_attributes_opt to resolve this. Signed-off-by: Jaskaran Singh --- parsing_c/parser_c.mly | 34 +- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a

[Cocci] [PATCH 3/3] parsing_cocci: unify_ast: Apply unify_mcode on macrodecl attrs

2020-06-11 Thread Jaskaran Singh
The following commit introduced some poor management of attributes in unify_ast.ml: b4b8653bd5a9607922e0050fe2fede10d422b218 Apply unify_mcode on macrodecl attributes in unify_ast.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/unify_ast.ml | 3 ++- 1 file changed, 2 insertions

[Cocci] [PATCH 2/3] parsing_cocci: context_neg: Apply equal_mcode on cast/param attrs

2020-06-11 Thread Jaskaran Singh
The following commits introduced some poor management of attributes in context_neg.ml: 2b7e99a5b86d41e05980c8a9d98eb931e42bb4d8 08f1cd9fb83ec400435e0ad8fdf579ec8f9c0f21 Apply equal_mcode on cast and parameter attributes in context_neg.ml. Signed-off-by: Jaskaran Singh

[Cocci] [PATCH 1/3] parsing_cocci: arity: Apply mcode2arity on macrodecl/param attrs

2020-06-11 Thread Jaskaran Singh
The following commits introduced some poor management of attributes in arity.ml: 08f1cd9fb83ec400435e0ad8fdf579ec8f9c0f21 b4b8653bd5a9607922e0050fe2fede10d422b218 Apply mcode2arity to macrodecl and parameter attributes. Signed-off-by: Jaskaran Singh --- parsing_cocci/arity.ml

[Cocci] [PATCH 0/3] parsing_cocci: Improve attr management in context_neg et al

2020-06-11 Thread Jaskaran Singh
/20200529120703.31145-1-jaskaransingh7654...@gmail.com [3] [PATCH 00/30] cocci: Add macrodecl attributes to C and SmPL ASTs https://lore.kernel.org/cocci/20200524171935.2504-1-jaskaransingh7654...@gmail.com Jaskaran Singh (3): parsing_cocci: arity: Apply mcode2arity on macrodecl/param attrs

Re: [Cocci] Software analysis around data type annotations

2020-06-16 Thread Jaskaran Singh
Hi Markus, I'm away from my computer right now so can't test this, but try declaring __iomem as an attribute: @display@ identifier action; attribute name __iomem; @@ On Tue, 16 Jun 2020, 10:21 p.m. Markus Elfring Hello, > > The support for data processing with attributes was extended recently.

Re: [Cocci] Software analysis around data type annotations

2020-06-17 Thread Jaskaran Singh
On Wed, 2020-06-17 at 09:30 +0200, Markus Elfring wrote: > > I'm away from my computer right now so can't test this, but try > > declaring __iomem as an attribute: > > @display@ > attribute name __iomem; > identifier action; > @@ > *void __iomem * action(...) > { ... } > > > elfring@Sonne:~/Pro

[Cocci] [PATCH 00/20] parsing_cocci: Wrap SmPL Attributes

2020-07-03 Thread Jaskaran Singh
This patch series aims to wrap the existing attribute type on the SmPL side. Wrapping attributes is necessary to add support for meta attributes in SmPL. Jaskaran Singh (20): parsing_cocci: ast0_cocci: Wrap SmPL Attributes parsing_cocci: parser: Wrap SmPL Attributes

[Cocci] [PATCH 18/20] parsing_c: unparse_cocci: Wrap SmPL Attributes

2020-07-03 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in unparse_cocci.ml. Signed-off-by: Jaskaran Singh --- parsing_c/unparse_cocci.ml | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/parsing_c/unparse_cocci.ml b/parsing_c

[Cocci] [PATCH 08/20] parsing_cocci: iso_pattern: Wrap SmPL Attributes

2020-07-03 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in iso_pattern.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/iso_pattern.ml | 68 ++-- 1 file changed, 27 insertions(+), 41 deletions(-) diff --git a/parsing_cocci/iso_pattern.ml b/parsing_cocci

[Cocci] [PATCH 16/20] parsing_cocci: unify_ast: Wrap SmPL Attributes

2020-07-03 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in unify_ast.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/unify_ast.ml | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/parsing_cocci/unify_ast.ml b/parsing_cocci/unify_ast.ml index

[Cocci] [PATCH 19/20] engine: cocci_vs_c: Wrap SmPL Attributes

2020-07-03 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in cocci_vs_c.ml. Signed-off-by: Jaskaran Singh --- engine/cocci_vs_c.ml | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/engine/cocci_vs_c.ml b/engine/cocci_vs_c.ml index 7abc4d53..3199d54d 100644

[Cocci] [PATCH 04/20] parsing_cocci: adjust_pragmas: Wrap SmPL Attributes

2020-07-03 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in adjust_pragmas.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/adjust_pragmas.ml | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/parsing_cocci/adjust_pragmas.ml b/parsing_cocci/adjust_pragmas.ml

[Cocci] [PATCH 12/20] parsing_cocci: ast_cocci: Wrap SmPL Attributes

2020-07-03 Thread Jaskaran Singh
SmPL attributes need to be wrapped to provide support for meta attributes. Wrap attributes in the SmPL AST. Signed-off-by: Jaskaran Singh --- parsing_cocci/ast_cocci.ml | 5 - parsing_cocci/ast_cocci.mli | 5 - 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a

[Cocci] [PATCH 02/20] parsing_cocci: parser: Wrap SmPL Attributes

2020-07-03 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reciprocate this and wrap attributes in the SmPL parser. Signed-off-by: Jaskaran Singh --- parsing_cocci/parse_aux.ml| 3 +++ parsing_cocci/parse_aux.mli | 7 +++ parsing_cocci/parser_cocci_menhir.mly | 18 ++ 3

[Cocci] [PATCH 20/20] ocaml: coccilib: Wrap SmPL Attributes

2020-07-03 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in coccilib.mli. Signed-off-by: Jaskaran Singh --- ocaml/coccilib.mli | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ocaml/coccilib.mli b/ocaml/coccilib.mli index 24b5f1ae..010b8aab 100644 --- a/ocaml

[Cocci] [PATCH 06/20] parsing_cocci: compute_lines: Wrap SmPL Attributes

2020-07-03 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in compute_lines.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/compute_lines.ml | 42 +++--- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/parsing_cocci/compute_lines.ml b

[Cocci] [PATCH 13/20] parsing_cocci: visitor_ast: Wrap SmPL Attributes

2020-07-03 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Create a function for attributes in the SmPL AST visitor. This function has not been added to the visitor API yet. Signed-off-by: Jaskaran Singh --- parsing_cocci/visitor_ast.ml | 48 +++- 1 file changed, 31 insertions

[Cocci] [PATCH 03/20] parsing_cocci: visitor_ast0: Wrap SmPL Attributes

2020-07-03 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Create a function for attributes in the SmPL AST0 visitor. This function has not been added to the visitor API yet. Signed-off-by: Jaskaran Singh --- parsing_cocci/visitor_ast0.ml | 27 ++- 1 file changed, 18 insertions(+), 9

[Cocci] [PATCH 11/20] parsing_cocci: ast0toast: Wrap SmPL Attributes

2020-07-03 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in ast0toast.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/ast0toast.ml | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/parsing_cocci/ast0toast.ml b/parsing_cocci/ast0toast.ml index

[Cocci] [PATCH 07/20] parsing_cocci: context_neg: Wrap SmPL Attributes

2020-07-03 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in context_neg.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/context_neg.ml | 31 --- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/parsing_cocci/context_neg.ml b/parsing_cocci

[Cocci] [PATCH 14/20] parsing_cocci: get_constants2: Wrap SmPL Attributes

2020-07-03 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in get_constants2.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/get_constants2.ml | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/parsing_cocci/get_constants2.ml b/parsing_cocci/get_constants2.ml index

[Cocci] [PATCH 05/20] parsing_cocci: arity: Wrap SmPL Attributes

2020-07-03 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in arity.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/arity.ml | 67 +++--- 1 file changed, 31 insertions(+), 36 deletions(-) diff --git a/parsing_cocci/arity.ml b/parsing_cocci/arity.ml

[Cocci] [PATCH 15/20] parsing_cocci: safe_for_multi_decls: Wrap SmPL Attributes

2020-07-03 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in safe_for_multi_decls.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/safe_for_multi_decls.ml | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/parsing_cocci/safe_for_multi_decls.ml b/parsing_cocci

[Cocci] [PATCH 09/20] parsing_cocci: index: Wrap SmPL Attributes

2020-07-03 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Assign the Attribute variant an index. Signed-off-by: Jaskaran Singh --- parsing_cocci/index.ml | 6 +- parsing_cocci/index.mli | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/parsing_cocci/index.ml b/parsing_cocci/index.ml index

[Cocci] [PATCH 01/20] parsing_cocci: ast0_cocci: Wrap SmPL Attributes

2020-07-03 Thread Jaskaran Singh
SmPL attributes need to be wrapped to provide support for meta attributes. Wrap attributes in AST0 of SmPL. Signed-off-by: Jaskaran Singh --- parsing_cocci/ast0_cocci.ml | 5 - parsing_cocci/ast0_cocci.mli | 5 - 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a

[Cocci] [PATCH 17/20] parsing_cocci: pretty_print_cocci: Wrap SmPL Attributes

2020-07-03 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in pretty_print_cocci.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/pretty_print_cocci.ml | 34 ++--- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/parsing_cocci/pretty_print_cocci.ml

[Cocci] [PATCH 10/20] parsing_cocci: unparse_ast0: Wrap SmPL Attributes

2020-07-03 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in unparse_ast0.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/unparse_ast0.ml | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/parsing_cocci/unparse_ast0.ml b

Re: [Cocci] [PATCH 02/20] parsing_cocci: parser: Wrap SmPL Attributes

2020-07-07 Thread Jaskaran Singh
On Mon, 2020-07-06 at 22:03 +0200, Julia Lawall wrote: > > On Fri, 3 Jul 2020, Jaskaran Singh wrote: > > > Attributes are wrapped in the SmPL AST. Reciprocate this and wrap > > attributes in the SmPL parser. > > This doesn't apply for me. > Ah, I missed the

[Cocci] [PATCH 19/20] engine: cocci_vs_c: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in cocci_vs_c.ml. Signed-off-by: Jaskaran Singh --- engine/cocci_vs_c.ml | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/engine/cocci_vs_c.ml b/engine/cocci_vs_c.ml index 7abc4d53..3199d54d 100644

[Cocci] [PATCH 16/20] parsing_cocci: unify_ast: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in unify_ast.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/unify_ast.ml | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/parsing_cocci/unify_ast.ml b/parsing_cocci/unify_ast.ml index

[Cocci] [PATCH 01/20] parsing_cocci: ast0_cocci: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
SmPL attributes need to be wrapped to provide support for meta attributes. Wrap attributes in AST0 of SmPL. Signed-off-by: Jaskaran Singh --- parsing_cocci/ast0_cocci.ml | 5 - parsing_cocci/ast0_cocci.mli | 5 - 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a

[Cocci] [PATCH 03/20] parsing_cocci: visitor_ast0: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Create a function for attributes in the SmPL AST0 visitor. This function has not been added to the visitor API yet. Signed-off-by: Jaskaran Singh --- parsing_cocci/visitor_ast0.ml | 27 ++- 1 file changed, 18 insertions(+), 9

[Cocci] [PATCH 05/20] parsing_cocci: arity: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in arity.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/arity.ml | 67 +++--- 1 file changed, 31 insertions(+), 36 deletions(-) diff --git a/parsing_cocci/arity.ml b/parsing_cocci/arity.ml

[Cocci] [PATCH 06/20] parsing_cocci: compute_lines: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in compute_lines.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/compute_lines.ml | 42 +++--- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/parsing_cocci/compute_lines.ml b

[Cocci] [PATCH 04/20] parsing_cocci: adjust_pragmas: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in adjust_pragmas.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/adjust_pragmas.ml | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/parsing_cocci/adjust_pragmas.ml b/parsing_cocci/adjust_pragmas.ml

[Cocci] [PATCH 09/20] parsing_cocci: index: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Assign the Attribute variant an index. Signed-off-by: Jaskaran Singh --- parsing_cocci/index.ml | 6 +- parsing_cocci/index.mli | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/parsing_cocci/index.ml b/parsing_cocci/index.ml index

[Cocci] [PATCH 10/20] parsing_cocci: unparse_ast0: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in unparse_ast0.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/unparse_ast0.ml | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/parsing_cocci/unparse_ast0.ml b

[Cocci] [PATCH 17/20] parsing_cocci: pretty_print_cocci: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in pretty_print_cocci.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/pretty_print_cocci.ml | 34 ++--- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/parsing_cocci/pretty_print_cocci.ml

[Cocci] [PATCH 18/20] parsing_c: unparse_cocci: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in unparse_cocci.ml. Signed-off-by: Jaskaran Singh --- parsing_c/unparse_cocci.ml | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/parsing_c/unparse_cocci.ml b/parsing_c

[Cocci] [PATCH 12/20] parsing_cocci: ast_cocci: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
SmPL attributes need to be wrapped to provide support for meta attributes. Wrap attributes in the SmPL AST. Signed-off-by: Jaskaran Singh --- parsing_cocci/ast_cocci.ml | 5 - parsing_cocci/ast_cocci.mli | 5 - 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a

[Cocci] [PATCH 02/20] parsing_cocci: parser: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reciprocate this and wrap attributes in the SmPL parser. Signed-off-by: Jaskaran Singh --- parsing_cocci/parse_aux.ml| 3 +++ parsing_cocci/parse_aux.mli | 7 +++ parsing_cocci/parser_cocci_menhir.mly | 18 ++ 3

[Cocci] [PATCH 07/20] parsing_cocci: context_neg: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in context_neg.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/context_neg.ml | 31 --- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/parsing_cocci/context_neg.ml b/parsing_cocci

[Cocci] [PATCH 11/20] parsing_cocci: ast0toast: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in ast0toast.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/ast0toast.ml | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/parsing_cocci/ast0toast.ml b/parsing_cocci/ast0toast.ml index

[Cocci] [PATCH 13/20] parsing_cocci: visitor_ast: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Create a function for attributes in the SmPL AST visitor. This function has not been added to the visitor API yet. Signed-off-by: Jaskaran Singh --- parsing_cocci/visitor_ast.ml | 48 +++- 1 file changed, 31 insertions

[Cocci] [PATCH 20/20] ocaml: coccilib: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in coccilib.mli. Signed-off-by: Jaskaran Singh --- ocaml/coccilib.mli | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ocaml/coccilib.mli b/ocaml/coccilib.mli index 24b5f1ae..010b8aab 100644 --- a/ocaml

[Cocci] [PATCH 15/20] parsing_cocci: safe_for_multi_decls: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in safe_for_multi_decls.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/safe_for_multi_decls.ml | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/parsing_cocci/safe_for_multi_decls.ml b/parsing_cocci

[Cocci] [PATCH 08/20] parsing_cocci: iso_pattern: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in iso_pattern.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/iso_pattern.ml | 68 ++-- 1 file changed, 27 insertions(+), 41 deletions(-) diff --git a/parsing_cocci/iso_pattern.ml b/parsing_cocci

[Cocci] [PATCH 14/20] parsing_cocci: get_constants2: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in get_constants2.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/get_constants2.ml | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/parsing_cocci/get_constants2.ml b/parsing_cocci/get_constants2.ml index

[Cocci] [PATCH v2 00/20] parsing_cocci: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
matching regexps parsing_cocci: arity: Wrap SmPL Attributes - Use literal tab wherever suitable - Fix space-before-tab errors Jaskaran Singh (20): parsing_cocci: ast0_cocci: Wrap SmPL Attributes parsing_cocci: parser: Wrap SmPL Attributes parsing_cocci: visitor_ast0: Wrap SmPL

Re: [Cocci] [PATCH v2 00/20] parsing_cocci: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
On Wed, 2020-07-08 at 18:23 +0530, Jaskaran Singh wrote: > This patch series aims to wrap the existing attribute type on the > SmPL > side. Wrapping attributes is necessary to add support for meta > attributes in SmPL. > Whoops, this is the wrong version. Let me send this again.

[Cocci] [PATCH v2 RESEND 01/20] parsing_cocci: ast0_cocci: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
SmPL attributes need to be wrapped to provide support for meta attributes. Wrap attributes in AST0 of SmPL. Signed-off-by: Jaskaran Singh --- parsing_cocci/ast0_cocci.ml | 5 - parsing_cocci/ast0_cocci.mli | 5 - 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a

[Cocci] [PATCH v2 RESEND 06/20] parsing_cocci: compute_lines: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in compute_lines.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/compute_lines.ml | 42 +++--- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/parsing_cocci/compute_lines.ml b

[Cocci] [PATCH v2 RESEND 04/20] parsing_cocci: adjust_pragmas: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in adjust_pragmas.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/adjust_pragmas.ml | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/parsing_cocci/adjust_pragmas.ml b/parsing_cocci/adjust_pragmas.ml

[Cocci] [PATCH v2 RESEND 13/20] parsing_cocci: visitor_ast: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Create a function for attributes in the SmPL AST visitor. This function has not been added to the visitor API yet. Signed-off-by: Jaskaran Singh --- parsing_cocci/visitor_ast.ml | 48 +++- 1 file changed, 31 insertions

[Cocci] [PATCH v2 RESEND 11/20] parsing_cocci: ast0toast: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in ast0toast.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/ast0toast.ml | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/parsing_cocci/ast0toast.ml b/parsing_cocci/ast0toast.ml index

[Cocci] [PATCH v2 RESEND 08/20] parsing_cocci: iso_pattern: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in iso_pattern.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/iso_pattern.ml | 68 ++-- 1 file changed, 27 insertions(+), 41 deletions(-) diff --git a/parsing_cocci/iso_pattern.ml b/parsing_cocci

[Cocci] [PATCH v2 RESEND 00/20] parsing_cocci: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
matching regexps parsing_cocci: arity: Wrap SmPL Attributes - Use literal tab wherever suitable - Fix space-before-tab errors Jaskaran Singh (20): parsing_cocci: ast0_cocci: Wrap SmPL Attributes parsing_cocci: parser: Wrap SmPL Attributes parsing_cocci: visitor_ast0: Wrap SmPL

[Cocci] [PATCH v2 RESEND 07/20] parsing_cocci: context_neg: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in context_neg.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/context_neg.ml | 31 --- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/parsing_cocci/context_neg.ml b/parsing_cocci

[Cocci] [PATCH v2 RESEND 12/20] parsing_cocci: ast_cocci: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
SmPL attributes need to be wrapped to provide support for meta attributes. Wrap attributes in the SmPL AST. Signed-off-by: Jaskaran Singh --- parsing_cocci/ast_cocci.ml | 5 - parsing_cocci/ast_cocci.mli | 5 - 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a

[Cocci] [PATCH v2 RESEND 14/20] parsing_cocci: get_constants2: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in get_constants2.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/get_constants2.ml | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/parsing_cocci/get_constants2.ml b/parsing_cocci/get_constants2.ml index

[Cocci] [PATCH v2 RESEND 02/20] parsing_cocci: parser: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reciprocate this and wrap attributes in the SmPL parser. Signed-off-by: Jaskaran Singh --- parsing_cocci/parse_aux.ml| 3 +++ parsing_cocci/parse_aux.mli | 7 +++ parsing_cocci/parser_cocci_menhir.mly | 18 ++ 3

[Cocci] [PATCH v2 RESEND 17/20] parsing_cocci: pretty_print_cocci: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in pretty_print_cocci.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/pretty_print_cocci.ml | 34 ++--- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/parsing_cocci/pretty_print_cocci.ml

[Cocci] [PATCH v2 RESEND 10/20] parsing_cocci: unparse_ast0: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in unparse_ast0.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/unparse_ast0.ml | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/parsing_cocci/unparse_ast0.ml b

[Cocci] [PATCH v2 RESEND 19/20] engine: cocci_vs_c: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in cocci_vs_c.ml. Signed-off-by: Jaskaran Singh --- engine/cocci_vs_c.ml | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/engine/cocci_vs_c.ml b/engine/cocci_vs_c.ml index 704c18e0..9439cdb3 100644

[Cocci] [PATCH v2 RESEND 15/20] parsing_cocci: safe_for_multi_decls: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in safe_for_multi_decls.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/safe_for_multi_decls.ml | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/parsing_cocci/safe_for_multi_decls.ml b/parsing_cocci

[Cocci] [PATCH v2 RESEND 05/20] parsing_cocci: arity: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in arity.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/arity.ml | 55 +++--- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/parsing_cocci/arity.ml b/parsing_cocci/arity.ml

[Cocci] [PATCH v2 RESEND 16/20] parsing_cocci: unify_ast: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in unify_ast.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/unify_ast.ml | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/parsing_cocci/unify_ast.ml b/parsing_cocci/unify_ast.ml index

[Cocci] [PATCH v2 RESEND 18/20] parsing_c: unparse_cocci: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in unparse_cocci.ml. Signed-off-by: Jaskaran Singh --- parsing_c/unparse_cocci.ml | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/parsing_c/unparse_cocci.ml b/parsing_c

[Cocci] [PATCH v2 RESEND 20/20] ocaml: coccilib: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Reflect these changes in coccilib.mli. Signed-off-by: Jaskaran Singh --- ocaml/coccilib.mli | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ocaml/coccilib.mli b/ocaml/coccilib.mli index 24b5f1ae..010b8aab 100644 --- a/ocaml

[Cocci] [PATCH v2 RESEND 03/20] parsing_cocci: visitor_ast0: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Create a function for attributes in the SmPL AST0 visitor. This function has not been added to the visitor API yet. Signed-off-by: Jaskaran Singh --- parsing_cocci/visitor_ast0.ml | 27 ++- 1 file changed, 18 insertions(+), 9

[Cocci] [PATCH v2 RESEND 09/20] parsing_cocci: index: Wrap SmPL Attributes

2020-07-08 Thread Jaskaran Singh
Attributes are wrapped in the SmPL AST. Assign the Attribute variant an index. Signed-off-by: Jaskaran Singh --- parsing_cocci/index.ml | 6 +- parsing_cocci/index.mli | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/parsing_cocci/index.ml b/parsing_cocci/index.ml index

[Cocci] [PATCH] parsing_cocci: parse_cocci: Extend is_permissible_proto list

2020-07-11 Thread Jaskaran Singh
Add more tokens (binary operators and colon) to the match ladder in is_permissible_proto. These cases would otherwise cause parsing errors for function calls after these tokens. Signed-off-by: Jaskaran Singh --- parsing_cocci/parse_cocci.ml | 19 ++- 1 file changed, 18

Re: [Cocci] [PATCH] parsing_cocci: parse_cocci: Extend is_permissible_proto list

2020-07-11 Thread Jaskaran Singh
On Sat, 2020-07-11 at 09:57 +0200, Julia Lawall wrote: > > On Sat, 11 Jul 2020, Jaskaran Singh wrote: > > > Add more tokens (binary operators and colon) to the match ladder in > > is_permissible_proto. These cases would otherwise cause parsing > > errors > > for

[Cocci] [PATCH 10/24] parsing_cocci: ast0_cocci: Add AttributeTag to SmPL AST0

2020-07-16 Thread Jaskaran Singh
Add the AttributeTag constructor to AST0 of SmPL. Signed-off-by: Jaskaran Singh --- parsing_cocci/ast0_cocci.ml | 2 ++ parsing_cocci/ast0_cocci.mli | 1 + 2 files changed, 3 insertions(+) diff --git a/parsing_cocci/ast0_cocci.ml b/parsing_cocci/ast0_cocci.ml index bfc0d145..d7d81001 100644

[Cocci] [PATCH 13/24] parsing_cocci: unparse_ast0: Reflect AttributeTag in SmPL AST0

2020-07-16 Thread Jaskaran Singh
AttributeTag is added to SmPL AST0. Reflect these changes in unparse_ast0.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/unparse_ast0.ml | 1 + 1 file changed, 1 insertion(+) diff --git a/parsing_cocci/unparse_ast0.ml b/parsing_cocci/unparse_ast0.ml index 109f1844..875282fb 100644 --- a

[Cocci] [PATCH 09/24] parsing_cocci: unitary_ast0: Reflect attributefn in AST0 visitor

2020-07-16 Thread Jaskaran Singh
The SmPL AST0 visitor has a function for attributes. Reflect these changes in unitary_ast0.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/unitary_ast0.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parsing_cocci/unitary_ast0.ml b/parsing_cocci/unitary_ast0.ml index

<    1   2   3   4   5   6   >