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] |
*if*?The drawback is that if a block has no statements, its not as convienient to add a statement. ie, if we write a gsi_insert_after() routine, its likely to be used something like this:
What makes you think this helps?gsi_stmt_interator i; i = gsi_start_bb (bb); ... n = new_stmt(...) gsi_insert_after (n, i) /* or something like this. */ If there are nothing but empty_stmt_nodes in the block, gsi_start_bb will set the iterator to NULL. So when it comes time to add the statement, we don't even know what block we are adding this statement to, let alone where.... The easiest thing to do to solve that problem would be to make the iterator have 2 words, the stmt pointer and the basic block it belongs to.
This would simplify many things I think, but it does have theSee above.
drawback of passing a couple of words around as an iterator instead of
just one. I doubt thats a huge deal, especially since a lot of routines
which operate on interators are inlined. Perhaps there is a better
option.
What does everyone else think? Any other alternatives for tackling this?
what other issues are there going to be?
Andrew
PS We could also skip error_mark_nodes ther same way too I suppose,
that's then remove the need to use is_exec_stmt() when traversing within
a block.
PPS I also dont think its an issue that the non-bb versions of gsi_*
work differently.... ? They give you an alternative which allows you to
look at everything...
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |