[Linux-kernel-mentees] [PATCH 13/13] tools: spgen: Reflect visitor changes

Jaskaran Singh jaskaransingh7654321 at gmail.com
Sun Mar 8 08:43:56 UTC 2020


Visitor_ast0 has changes with respect to enums. Reflect these
changes in spgen by adding additional arguments in the combiners
and rebuilders.

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

diff --git a/tools/spgen/source/detect_patch.ml b/tools/spgen/source/detect_patch.ml
index 6cf1c538..0489afec 100644
--- a/tools/spgen/source/detect_patch.ml
+++ b/tools/spgen/source/detect_patch.ml
@@ -101,11 +101,13 @@ let patch_combiner =
   let dotsparamfn = donothing in
   let dotsdeclfn = donothing in
   let dotsfieldfn = donothing in
+  let dotsenumdeclfn = donothing in
   let dotscasefn = donothing in
   let dotsdefparfn = donothing in
   let assignOpfn = donothing in
   let binaryOpfn = donothing in
   let initfn = donothing in
+  let enumdeclfn = donothing in
   let paramfn = donothing in
   let forinfofn = donothing in
   let string_fragmentfn = donothing in
@@ -159,9 +161,9 @@ let patch_combiner =
     fix_mcode unary_mcode arithOp_mcode logicalOp_mcode cv_mcode sign_mcode
     struct_mcode storage_mcode inc_mcode
     dotsexprfn dotsinitfn dotsparamfn dotsstmtfn dotsdeclfn dotsfieldfn
-    dotscasefn dotsdefparfn
+    dotsenumdeclfn dotscasefn dotsdefparfn
     identfn exprfn assignOpfn binaryOpfn tyfn initfn paramfn declfn fieldfn
-    stmtfn forinfofn casefn string_fragmentfn topfn
+    enumdeclfn stmtfn forinfofn casefn string_fragmentfn topfn
 
 
 (* ------------------------------------------------------------------------- *)
diff --git a/tools/spgen/source/meta_variable.ml b/tools/spgen/source/meta_variable.ml
index 7adfacad..a1804a05 100644
--- a/tools/spgen/source/meta_variable.ml
+++ b/tools/spgen/source/meta_variable.ml
@@ -390,11 +390,13 @@ let metavar_combiner rn =
   let dotsstmtfn = donothing in
   let dotsdeclfn = donothing in
   let dotsfieldfn = donothing in
+  let dotsenumdeclfn = donothing in
   let dotscasefn = donothing in
   let dotsdefparfn = donothing in
   let forinfofn = donothing in
   let casefn = donothing in
   let topfn = donothing in
+  let enumdeclfn = donothing in
 
   (* --- These are shortened formatting functions that return MVSets --- *)
 
@@ -574,9 +576,9 @@ let metavar_combiner rn =
     fix_mcode unary_mcode arithOp_mcode logicalOp_mcode cv_mcode sign_mcode
     struct_mcode storage_mcode inc_mcode
     dotsexprfn dotsinitfn dotsparamfn dotsstmtfn dotsdeclfn dotsfieldfn
-    dotscasefn dotsdefparfn
+    dotsenumdeclfn dotscasefn dotsdefparfn
     identfn exprfn assignOpfn binaryOpfn tyfn initfn paramfn declfn fieldfn
-    stmtfn forinfofn casefn string_fragmentfn topfn
+    enumdeclfn stmtfn forinfofn casefn string_fragmentfn topfn
 
 
 (* ------------------------------------------------------------------------- *)
diff --git a/tools/spgen/source/rule_body.ml b/tools/spgen/source/rule_body.ml
index 6345c9df..163dff9a 100644
--- a/tools/spgen/source/rule_body.ml
+++ b/tools/spgen/source/rule_body.ml
@@ -219,12 +219,14 @@ let rec gen_combiner ~context_mode =
   let dotsparamfn = donothing in
   let dotsdeclfn = donothing in
   let dotsfieldfn = donothing in
+  let dotsenumdeclfn = donothing in
   let dotscasefn = donothing in
   let dotsdefparfn = donothing in
   let assignOpfn = donothing in
   let binaryOpfn = donothing in
   let tyfn = donothing in
   let initfn = donothing in
+  let enumdeclfn = donothing in
   let paramfn = donothing in
   let forinfofn = donothing in
   let casefn = donothing in
@@ -349,9 +351,9 @@ let rec gen_combiner ~context_mode =
     fix_mcode unary_mcode arithOp_mcode logicalOp_mcode cv_mcode sign_mcode
     struct_mcode storage_mcode inc_mcode
     dotsexprfn dotsinitfn dotsparamfn dotsstmtfn dotsdeclfn dotsfieldfn
-    dotscasefn dotsdefparfn
+    dotsenumdeclfn dotscasefn dotsdefparfn
     identfn exprfn assignOpfn binaryOpfn tyfn initfn paramfn declfn fieldfn
-    stmtfn forinfofn casefn string_fragmentfn topfn
+    enumdeclfn stmtfn forinfofn casefn string_fragmentfn topfn
 
 
 (* ------------------------------------------------------------------------- *)
-- 
2.21.1



More information about the Linux-kernel-mentees mailing list