unify two copies of the NamedMDNode printing code.
[oota-llvm.git] / lib / Support / regengine.inc
index ac848bcec882fea319929b4a47afead93a122741..0f27cfd4b5b8f0d4ed2b01bf222de5a02c3ffd9f 100644 (file)
@@ -302,7 +302,6 @@ dissect(struct match *m, char *start, char *stop, sopno startst, sopno stopst)
        char *ssp;      /* start of string matched by subsubRE */
        char *sep;      /* end of string matched by subsubRE */
        char *oldssp;   /* previous ssp */
-       char *dp;
 
        AT("diss", start, stop, startst, stopst);
        sp = start;
@@ -361,7 +360,8 @@ dissect(struct match *m, char *start, char *stop, sopno startst, sopno stopst)
                        esub = es - 1;
                        /* did innards match? */
                        if (slow(m, sp, rest, ssub, esub) != NULL) {
-                               dp = dissect(m, sp, rest, ssub, esub);
+                               char *dp = dissect(m, sp, rest, ssub, esub);
+                               (void)dp; /* avoid warning if assertions off */
                                assert(dp == rest);
                        } else          /* no */
                                assert(sp == rest);
@@ -399,8 +399,11 @@ dissect(struct match *m, char *start, char *stop, sopno startst, sopno stopst)
                        }
                        assert(sep == rest);    /* must exhaust substring */
                        assert(slow(m, ssp, sep, ssub, esub) == rest);
-                       dp = dissect(m, ssp, sep, ssub, esub);
-                       assert(dp == sep);
+                       {
+                               char *dp = dissect(m, ssp, sep, ssub, esub);
+                               (void)dp; /* avoid warning if assertions off */
+                               assert(dp == sep);
+                       }
                        sp = rest;
                        break;
                case OCH_:
@@ -434,8 +437,11 @@ dissect(struct match *m, char *start, char *stop, sopno startst, sopno stopst)
                                else
                                        assert(OP(m->g->strip[esub]) == O_CH);
                        }
-                       dp = dissect(m, sp, rest, ssub, esub);
-                       assert(dp == rest);
+                       {
+                               char *dp = dissect(m, sp, rest, ssub, esub);
+                               (void)dp; /* avoid warning if assertions off */
+                               assert(dp == rest);
+                       }
                        sp = rest;
                        break;
                case O_PLUS: