gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-1681-gf0141f


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-1681-gf0141fd
Date: Wed, 02 Mar 2016 19:49:30 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, master has been updated
       via  f0141fdfcfd870de22d54baaa3551b2aae0dac6f (commit)
       via  2693fc3368628e377bb9c29ba1ba1f6ab091fac5 (commit)
      from  b8d9a73257e1984eae80e61f0b751ddc4e9eab25 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=f0141fdfcfd870de22d54baaa3551b2aae0dac6f

commit f0141fdfcfd870de22d54baaa3551b2aae0dac6f
Author: Arnold D. Robbins <address@hidden>
Date:   Wed Mar 2 20:54:11 2016 +0200

    Improvements in debug.c for if and else.

diff --git a/ChangeLog b/ChangeLog
index 5c73d42..414efea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-02         Arnold D. Robbins     <address@hidden>
+
+       * debug.c (print_instruction): Improvements in instruction dump
+       for if and else.
+
 2016-03-01         Arnold D. Robbins     <address@hidden>
 
        * debug.c (print_instruction): For Op_comment, add notation as
diff --git a/debug.c b/debug.c
index 574b303..7bf3450 100644
--- a/debug.c
+++ b/debug.c
@@ -3796,6 +3796,15 @@ print_instruction(INSTRUCTION *pc, Func_print 
print_func, FILE *fp, int in_dump)
 
                        
        switch (pc->opcode) {
+       case Op_K_if:
+               print_func(fp, "[branch_if = %p] [branch_else = %p] 
[branch_else->lasti = %p]\n",
+                               pc->branch_if, pc->branch_else, 
pc->branch_else->lasti);
+               break;
+
+       case Op_K_else:
+               print_func(fp, "[branch_end = %p]\n", pc->branch_end);
+               break;
+
        case Op_var_update:
                print_func(fp, "[update_%s()]\n", 
get_spec_varname(pc->update_var));
                break;

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=2693fc3368628e377bb9c29ba1ba1f6ab091fac5

commit 2693fc3368628e377bb9c29ba1ba1f6ab091fac5
Author: Arnold D. Robbins <address@hidden>
Date:   Wed Mar 2 20:52:49 2016 +0200

    Revert b8d9a73257e1984eae80e61f0b751ddc4e9eab25.

diff --git a/ChangeLog b/ChangeLog
index 915bb79..5c73d42 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,3 @@
-2016-03-02         Arnold D. Robbins     <address@hidden>
-
-       * debug.c (print_instruction): Add additional stuff for
-       Op_K_if and Op_K_else.
-
 2016-03-01         Arnold D. Robbins     <address@hidden>
 
        * debug.c (print_instruction): For Op_comment, add notation as
diff --git a/profile.c b/profile.c
index 55bf42e..9e4a9b0 100644
--- a/profile.c
+++ b/profile.c
@@ -192,22 +192,6 @@ pp_free(NODE *n)
        freenode(n);
 }
 
-/* get_next_real_inst --- skip Op_comment */
-
-static INSTRUCTION *
-get_next_real_inst(INSTRUCTION *pc)
-{
-       if (pc == NULL)
-               return pc;
-
-       for (; pc != NULL && pc->opcode == Op_comment; pc = pc->nexti) {
-fprintf(stderr, "%s: opcode is %s\n", __func__, opcode2str(pc->opcode));
-               continue;
-       }
-
-       return pc;
-}
-
 /* pprint --- pretty print a program segment */
 
 static void
@@ -223,7 +207,6 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int flags)
        char *tmp;
        int rule;
        static int rule_count[MAXRULE];
-       INSTRUCTION *next_real;
 
        for (pc = startp; pc != endp; pc = pc->nexti) {
                if (pc->source_line > 0)
@@ -759,16 +742,8 @@ cleanup:
                        t1 = pp_pop();
                        if (is_binary(t1->type))
                                pp_parenthesize(t1);
-                       if (pc->source_line > 0) {      /* don't print implicit 
'return' at end of function */
-                               if (pc->nexti->opcode != Op_comment || 
pc->nexti->memory->comment_type != EOL_COMMENT)
-                                       fprintf(prof_fp, "%s %s\n", 
op2str(pc->opcode), t1->pp_str);
-                               else {
-                                       fprintf(prof_fp, "%s %s", 
op2str(pc->opcode), t1->pp_str);
-                                       // print the comment
-                                       print_comment(pc->nexti, 0);
-                                       pc = pc->nexti;         /* skip it */
-                               }
-                       }
+                       if (pc->source_line > 0)        /* don't print implicit 
'return' at end of function */
+                               fprintf(prof_fp, "%s %s\n", op2str(pc->opcode), 
t1->pp_str);
                        pp_free(t1);
                        break;
 
@@ -954,9 +929,8 @@ cleanup:
                         */
 
                        fprintf(prof_fp, "} %s ", op2str(pc->opcode));
-                       next_real = get_next_real_inst(pc->nexti);
-                       if (next_real->nexti->opcode == Op_K_if
-                           && pc->branch_end == 
next_real->nexti->branch_else->nexti) {
+                       if (pc->nexti->nexti->opcode == Op_K_if
+                           && pc->branch_end == 
pc->nexti->nexti->branch_else->lasti) {
                                pprint(pc->nexti, pc->branch_end, IN_ELSE_IF);
                        } else {
                                fprintf(prof_fp, "{\n");

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog |    4 ++--
 debug.c   |    9 +++++++++
 profile.c |   34 ++++------------------------------
 3 files changed, 15 insertions(+), 32 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]