This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[GSoC][match-and-simplify] reject for that has no pattern defined


Reject for that has no pattern defined.
eg - (for op in plus minus)

* genmatch.c (parse_for): Reject for that has no pattern defined.

Thanks and Regards,
Prathamesh
Index: genmatch.c
===================================================================
--- genmatch.c	(revision 212928)
+++ genmatch.c	(working copy)
@@ -2059,14 +2059,18 @@ parse_for (cpp_reader *r, source_locatio
 
   vec<const char *> opers = vNULL;
 
+  const cpp_token *token;
   while (1)
     {
-      const cpp_token *token = peek (r);
+      token = peek (r); 
       if (token->type != CPP_NAME)
 	break;
       opers.safe_push (get_ident (r));
     }
 
+  if (token->type == CPP_CLOSE_PAREN)
+    fatal_at (token, "no pattern defined in for");
+
 
   while (1)
     {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]