shithub: mc

Download patch

ref: 8f668b2261b225f96d5835c17880a833447ebbcd
parent: 060f6f50d77006222083d987cf6adeed1701c9ae
author: Ori Bernstein <[email protected]>
date: Sun Aug 12 18:20:46 EDT 2012

Put match values into temporary.

    We don't need to constantly recompute it.

--- a/6/simp.c
+++ b/6/simp.c
@@ -492,13 +492,16 @@
 static void simpmatch(Simp *s, Node *n)
 {
     Node *end, *cur, *next; /* labels */
-    Node *val;
+    Node *val, *tmp;
     Node *m;
     size_t i;
     f = stdout;
 
     end = genlbl();
-    val = rval(s, n->matchstmt.val, NULL); /* FIXME: don't recompute, even if pure */
+    val = temp(s, n->matchstmt.val);
+    tmp = rval(s, n->matchstmt.val, val);
+    if (val != tmp)
+        append(s, set(val, tmp));
     for (i = 0; i < n->matchstmt.nmatches; i++) {
         m = n->matchstmt.matches[i];
 
--- a/opt/df.c
+++ b/opt/df.c
@@ -15,5 +15,5 @@
 
 void flow(Cfg *cfg)
 {
-    die("Flow analysis not implemented");
 }
+