diff options
| author | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-02-21 15:42:22 +0000 | 
|---|---|---|
| committer | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-02-21 15:42:22 +0000 | 
| commit | 1f1673640f56de4997896be0c54146ba637e4f93 (patch) | |
| tree | af1eeee393c7515fcfd511cabefdaa237e5e3f1d /gcc/java/jcf-write.c | |
| parent | 84c6ed874a4b6111ff9193b45d393fca6a08b38f (diff) | |
| download | ppe42-gcc-1f1673640f56de4997896be0c54146ba637e4f93.tar.gz ppe42-gcc-1f1673640f56de4997896be0c54146ba637e4f93.zip | |
	* decl.c (build_result_decl), java-tree.h:  New method.
	(complete_start_java_method):  Handle synchronized methods.
	Don't build DECL_RESULT here.  (Ordering dependency problem.)
	(start_java_method):  Call build_result_decl here instead  ...
	* parse.y (java_complete_expand_method):  ... and here.
	(expand_start_java_method): Don't call complete_start_java_method here.
	(java_complete_expand_method):  Call it here instead.
	* parse.h (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT):  Moved to ..
	* java-tree.h:  ... here.
	* expr.c (force_evaluation_order):  Fix typo, don't handle ARRAY_REF.
	* parse.y (java_complete_lhs):  Don't call force_evaluation_order
	for ARRAY_REF - it doesn't work when array bounds are checked.
	(patch_array_ref):  Handle it here instead.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25345 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/jcf-write.c')
| -rw-r--r-- | gcc/java/jcf-write.c | 21 | 
1 files changed, 20 insertions, 1 deletions
| diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c index 4d7b4403fe9..42d32d27ffa 100644 --- a/gcc/java/jcf-write.c +++ b/gcc/java/jcf-write.c @@ -2760,7 +2760,8 @@ generate_classfile (clas, state)        i = find_utf8_constant (&state->cpool, name);  PUT2 (i);        i = find_utf8_constant (&state->cpool, build_java_signature (type));        PUT2 (i); -      PUT2 (body != NULL_TREE ? 1 : 0);   /* attributes_count */ +      i = (body != NULL_TREE) + (DECL_FUNCTION_THROWS (part) != NULL_TREE); +      PUT2 (i);   /* attributes_count */        if (body != NULL_TREE)  	{  	  int code_attributes_count = 0; @@ -2876,6 +2877,24 @@ generate_classfile (clas, state)  		}  	    }  	} +      if (DECL_FUNCTION_THROWS (part) != NULL_TREE) +	{ +	  tree t = DECL_FUNCTION_THROWS (part); +	  int throws_count = list_length (t); +	  static tree Exceptions_node = NULL_TREE; +	  if (Exceptions_node == NULL_TREE) +	    Exceptions_node = get_identifier ("Exceptions"); +	  ptr = append_chunk (NULL, 8 + 2 * throws_count, state); +	  i = find_utf8_constant (&state->cpool, Exceptions_node); +	  PUT2 (i);  /* attribute_name_index */  +	  i = 2 + 2 * throws_count;  PUT4(i); /* attribute_length */  +	  i = throws_count;  PUT2 (i);  +	  for (;  t != NULL_TREE;  t = TREE_CHAIN (t)) +	    { +	      i = find_class_constant (&state->cpool, TREE_VALUE (t)); +	      PUT2 (i); +	    } +	}        methods_count++;        current_function_decl = save_function;      } | 

