[Linux-kernel-mentees] [PATCH 28/30] tools: spgen: Reflect Macrodecl attributes

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


Macrodecl attributes are added to the SmPL AST. Reflect these changes in
spgen.

Signed-off-by: Jaskaran Singh <jaskaransingh7654321 at gmail.com>
---
 tools/spgen/source/meta_variable.ml      | 2 +-
 tools/spgen/source/position_generator.ml | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/spgen/source/meta_variable.ml b/tools/spgen/source/meta_variable.ml
index 2197a3f6..31456614 100644
--- a/tools/spgen/source/meta_variable.ml
+++ b/tools/spgen/source/meta_variable.ml
@@ -538,7 +538,7 @@ let metavar_combiner rn =
         meta_mc_format ~mc ~typ:"declaration " ~constr
     | Ast0.AsDecl(dc1, dc2) ->
         let dec = c.VT0.combiner_rec_declaration in as_format dc1 dc2 dec dec
-    | Ast0.MacroDecl(_, id, _, expdots, _, _) ->
+    | Ast0.MacroDecl(_, id, _, expdots, _, _, _) ->
         let expids = c.VT0.combiner_rec_expression_dots expdots in
         MVSet.union (ids ~rn ~typ:"declarer" ~id) expids
     | Ast0.MacroDeclInit(_, id, _, expdots, _, _, ini, _) ->
diff --git a/tools/spgen/source/position_generator.ml b/tools/spgen/source/position_generator.ml
index 757faf5f..618ba19b 100644
--- a/tools/spgen/source/position_generator.ml
+++ b/tools/spgen/source/position_generator.ml
@@ -419,8 +419,8 @@ let rec declaration_pos decl snp
   | Ast0.Typedef (tm, tc, tc2, sem) ->
       let constructor ~mc = Ast0.Typedef (mc, tc, tc2, sem) in
       mcode_wrap ~mc:tm ~constructor snp
-  | Ast0.MacroDecl (st,id,lp,ed,rp,sem) ->
-      let constructor ~id = Ast0.MacroDecl (st, id, lp, ed, rp, sem) in
+  | Ast0.MacroDecl (st,id,lp,ed,rp,attr,sem) ->
+      let constructor ~id = Ast0.MacroDecl (st, id, lp, ed, rp, attr, sem) in
       id_wrap ~id ~constructor snp
   | Ast0.MacroDeclInit (st,id,lp,ed,rp,eq,init,sem) ->
       let constructor ~id = Ast0.MacroDeclInit (st,id,lp,ed,rp,eq,init,sem) in
-- 
2.21.1



More information about the Linux-kernel-mentees mailing list