This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tuples] change walk_gimple_stmt interface


On 3/4/08 6:14 AM, Aldy Hernandez wrote:

p.s. Diego, I have also documented walk_gimple_op in the API document.

Thanks. This reminds me that I've still not finished the revisions I had started a few days ago. I'll get those in this week.



+/* Helper function of WALK_GIMPLE_STMT.  Walk every tree operand in
+   STMT.  CALLBACK_OP and WI are as in WALK_GIMPLE_STMT.
+
+   If the callback returns non-NULL for any operand, the remaining
+   operands are not scanned.  */
+inline tree

Blank line after comment.


 tree
-walk_gimple_stmt (gimple stmt, walk_stmt_fn callback_stmt,
+walk_gimple_stmt (gimple_stmt_iterator *gsi, walk_stmt_fn callback_stmt,
 		  walk_tree_fn callback_op, struct walk_stmt_info *wi)

Since we are now passing GSI, we can save the client code from putting it in WI. On entry to walk_gimple_stmt we can copy it in WI. Not a big deal, though.



   memset (&wi, 0, sizeof (wi));
-  addr = walk_gimple_stmt (stmt, NULL, verify_expr, &wi);
+  addr = walk_gimple_stmt (gsi, NULL, verify_expr, &wi);

Shouldn't this be walk_gimple_op?



-	  gsi_next (&gsi);
-	  err |= verify_stmt (stmt, gsi_end_p (gsi));
-	  addr = walk_gimple_stmt (stmt, NULL, verify_node_sharing, &wi);
+	  err |= verify_stmt (&gsi);
+	  addr = walk_gimple_stmt (&gsi, NULL, verify_node_sharing, &wi);

Likewise here.



Thanks for the cleanup. This was starting to become a problem.



Diego.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]