[hackers] [scc] [cc1] Add fold case for !! || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Sat, 4 Feb 2017 22:05:04 +0100 (CET)

commit ce97999d1802923d4fe4507de5315b7819c6b312
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Sat Feb 4 22:01:03 2017 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Sat Feb 4 22:02:40 2017 +0100

    [cc1] Add fold case for !!
    
            !!(a || b)
    
    In this case we will have to ONEG together which can be folded.

diff --git a/cc1/fold.c b/cc1/fold.c
index 90a3445..c7df682 100644
--- a/cc1/fold.c
+++ b/cc1/fold.c
_AT_@ -377,6 +377,10 @@ foldunary(Node *np, Node *l)
         Node *aux;
 
         switch (np->op) {
+ case ONEG:
+ if (l->op == ONEG && l->next->op == ONEG)
+ break;
+ return NULL;
         case OADD:
                 DBG("FOLD unary delete %d", np->op);
                 np->left = NULL;
Received on Sat Feb 04 2017 - 22:05:04 CET

This archive was generated by hypermail 2.3.0 : Sat Feb 04 2017 - 22:12:19 CET