diff mbox

[GSoC,match-and-simplify] Remove gen_gimple_match_fail

Message ID CAJXstsBB+ouC9AUouEUMYT2iX_tRBNDZ-eyet8BLatdbEL991A@mail.gmail.com
State New
Headers show

Commit Message

Prathamesh Kulkarni June 23, 2014, 1:43 p.m. UTC
* genmatch.c (gen_gimple_match_fail): Remove.
  (expr::gen_gimple_transform): Remove call to gen_gimple_match_fail.
    Change fprintf (f, "if (!res)") to fprintf (f, "if (!res) return false;\n")

Thanks and Regards,
Prathamesh

Comments

Richard Biener June 23, 2014, 2:28 p.m. UTC | #1
On Mon, Jun 23, 2014 at 3:43 PM, Prathamesh Kulkarni
<bilbotheelffriend@gmail.com> wrote:
> * genmatch.c (gen_gimple_match_fail): Remove.
>   (expr::gen_gimple_transform): Remove call to gen_gimple_match_fail.
>     Change fprintf (f, "if (!res)") to fprintf (f, "if (!res) return false;\n")

Thanks, committed.

Richard.

> Thanks and Regards,
> Prathamesh
diff mbox

Patch

Index: gcc/genmatch.c
===================================================================
--- gcc/genmatch.c	(revision 211893)
+++ gcc/genmatch.c	(working copy)
@@ -452,15 +452,6 @@  commutate (operand *op)
 
 /* Code gen off the AST.  */
 
-static void
-gen_gimple_match_fail (FILE *f, const char *label)
-{
-  if (!label)
-    fprintf (f, "return NULL_TREE;\n");
-  else
-    fprintf (f, "goto %s;\n", label);
-}
-
 void
 expr::gen_gimple_transform (FILE *f, const char *label, const char *dest)
 {
@@ -481,8 +472,7 @@  expr::gen_gimple_transform (FILE *f, con
   for (unsigned i = 0; i < ops.length (); ++i)
     fprintf (f, ", ops[%u]", i);
   fprintf (f, ", seq, valueize);\n");
-  fprintf (f, "      if (!res) ");
-  gen_gimple_match_fail (f, label);
+  fprintf (f, "      if (!res) return false;\n");
   fprintf (f, "    }\n");
   fprintf (f, "  else\n");
   fprintf (f, "    res = gimple_build (seq, UNKNOWN_LOCATION, %s, "