shithub: mc

Download patch

ref: a2cc58be74896e3519b7054d7c507c4c76a54db2
parent: 076f0227af253fb49225135e5dbbfb2e2aba49e6
author: Ori Bernstein <[email protected]>
date: Wed May 6 12:59:28 EDT 2015

Rename 'df' to 'dfcheck'.

    It only checks stuff.

--- a/mi/Makefile
+++ b/mi/Makefile
@@ -2,7 +2,7 @@
 OBJ=cfg.o \
     fold.o \
     match.o \
-    df.o \
+    dfcheck.o \
 
 DEPS=../parse/libparse.a
 
--- a/mi/df.c
+++ /dev/null
@@ -1,70 +1,0 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <inttypes.h>
-#include <stdarg.h>
-#include <ctype.h>
-#include <string.h>
-#include <assert.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-#include "parse.h"
-#include "mi.h"
-
-/*
-static void nodeuse(Node *n, Bitset *bs)
-{
-}
-
-static void nodedef(Node *n, Bitset *bs)
-{
-}
-
-static void bbuse(Bb *bb, Bitset *bs)
-{
-}
-
-static void bbdef(Bb *bb, Bitset *bs)
-{
-}
-*/
-
-static void checkreach(Cfg *cfg)
-{
-}
-
-static void checkpredret(Cfg *cfg, Bb *bb)
-{
-    Bb *pred;
-    size_t i;
-
-    for (i = 0; bsiter(bb->pred, &i); i++) {
-        pred = cfg->bb[i];
-        if (pred->nnl == 0) {
-            checkpredret(cfg, pred);
-        } else if (exprop(pred->nl[pred->nnl - 1]) != Oret) {
-            dumpcfg(cfg, stdout);
-            fatal(pred->nl[pred->nnl-1], "Reaches end of function without return\n");
-        }
-    }
-}
-
-static void checkret(Cfg *cfg)
-{
-    Type *ft;
-
-    ft = tybase(decltype(cfg->fn));
-    assert(ft->type == Tyfunc);
-    if (ft->sub[0]->type == Tyvoid)
-        return;
-
-    checkpredret(cfg, cfg->end);
-}
-
-void check(Cfg *cfg)
-{
-    checkret(cfg);
-    checkreach(cfg);
-}
--- /dev/null
+++ b/mi/dfcheck.c
@@ -1,0 +1,70 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <inttypes.h>
+#include <stdarg.h>
+#include <ctype.h>
+#include <string.h>
+#include <assert.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "parse.h"
+#include "mi.h"
+
+/*
+static void nodeuse(Node *n, Bitset *bs)
+{
+}
+
+static void nodedef(Node *n, Bitset *bs)
+{
+}
+
+static void bbuse(Bb *bb, Bitset *bs)
+{
+}
+
+static void bbdef(Bb *bb, Bitset *bs)
+{
+}
+*/
+
+static void checkreach(Cfg *cfg)
+{
+}
+
+static void checkpredret(Cfg *cfg, Bb *bb)
+{
+    Bb *pred;
+    size_t i;
+
+    for (i = 0; bsiter(bb->pred, &i); i++) {
+        pred = cfg->bb[i];
+        if (pred->nnl == 0) {
+            checkpredret(cfg, pred);
+        } else if (exprop(pred->nl[pred->nnl - 1]) != Oret) {
+            dumpcfg(cfg, stdout);
+            fatal(pred->nl[pred->nnl-1], "Reaches end of function without return\n");
+        }
+    }
+}
+
+static void checkret(Cfg *cfg)
+{
+    Type *ft;
+
+    ft = tybase(decltype(cfg->fn));
+    assert(ft->type == Tyfunc);
+    if (ft->sub[0]->type == Tyvoid)
+        return;
+
+    checkpredret(cfg, cfg->end);
+}
+
+void check(Cfg *cfg)
+{
+    checkret(cfg);
+    checkreach(cfg);
+}