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: Inliner for Java


I can't say I've done a comprehensive review, but I say it might
as well go in.

You might consider geting rid of some #ifdef INLINER_FOR_JAVA
conditionals if they just guard code that isn't used by the
C inliner, but does use standard tree nodes.  For example:

+ #ifdef INLINER_FOR_JAVA
+     case EXIT_BLOCK_EXPR:
+       WALK_SUBTREE_TAIL (TREE_OPERAND (*tp, 1));
+
+     case SAVE_EXPR:
+       WALK_SUBTREE_TAIL (TREE_OPERAND (*tp, 0));
+ #endif /* INLINER_FOR_JAVA */

This doesn't really need the #ifdef.  One can argue that adding
the #ifdef keeps the C inliner smaller, but ultimately we want
a single inliner.

Similarly:

+ #else /* INLINER_FOR_JAVA */
+   else if (TREE_CODE (*tp) == LABELED_BLOCK_EXPR)
...
+   else if (TREE_CODE (*tp) == EXIT_BLOCK_EXPR)
...
+ #endif /* INLINER_FOR_JAVA */

could be just:

+ #endif /* ! INLINER_FOR_JAVA */
+   else if (TREE_CODE (*tp) == LABELED_BLOCK_EXPR)
...
+   else if (TREE_CODE (*tp) == EXIT_BLOCK_EXPR)
...

When it comes to add_stmt_to_compound, why is there a test
for !stmt?  Is there any case where it might be called with
a null statement?

Also, I think the test for 'existing' might be wrong.  Shouldn't
it be checking (existing != empty_stmt_node) instead?
--
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/


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