diff options
| author | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-11-12 14:26:08 +0000 | 
|---|---|---|
| committer | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-11-12 14:26:08 +0000 | 
| commit | 533bc3bcb62597cbc76c65fe24116a10d95461cd (patch) | |
| tree | 884f8404cb7e6d56ccfe5e971b9e4cde9ea2065f /gcc | |
| parent | e97418967c52d92c05f137516e58a9c010d98c83 (diff) | |
| download | ppe42-gcc-533bc3bcb62597cbc76c65fe24116a10d95461cd.tar.gz ppe42-gcc-533bc3bcb62597cbc76c65fe24116a10d95461cd.zip | |
�
	* class.c:  Remove some unused variables.
	* constants.c (find_string_constant):  New function.
	(count_constant_pool_bytes):  Fix to correctly handle wide constants.
	* decl.c (complete_start_java_method):  Don't _Jv_InitClass
	if flag_emit_class_files.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23616 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
| -rw-r--r-- | gcc/java/class.c | 5 | ||||
| -rw-r--r-- | gcc/java/constants.c | 23 | ||||
| -rw-r--r-- | gcc/java/decl.c | 3 | 
3 files changed, 22 insertions, 9 deletions
| diff --git a/gcc/java/class.c b/gcc/java/class.c index 47e9f5c93e6..8539219e3c2 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -422,7 +422,7 @@ add_method (this_class, access_flags, name, method_sig)       tree method_sig;  {    tree handle_class = CLASS_TO_HANDLE_TYPE (this_class); -  tree function_type, method_type, fndecl; +  tree function_type, fndecl;    unsigned char *sig = (unsigned char*)IDENTIFIER_POINTER (method_sig);    push_obstacks (&permanent_obstack, &permanent_obstack);    if (sig[0] != '(') @@ -1172,9 +1172,6 @@ append_gpp_mangled_type (obstack, type)       struct obstack *obstack;       tree type;  { -  char buf[8]; -  int len; -  char *ptr;    switch (TREE_CODE (type))      {        char code; diff --git a/gcc/java/constants.c b/gcc/java/constants.c index 507d4847387..6d4ad2f8fca 100644 --- a/gcc/java/constants.c +++ b/gcc/java/constants.c @@ -140,6 +140,18 @@ find_class_constant (cpool, type)  					build_internal_class_name (type));  } +/* Allocate a CONSTANT_string entry given a STRING_CST. */ + +int +find_string_constant (cpool, string) +     CPool *cpool; +     tree string; +{ +  string = get_identifier (TREE_STRING_POINTER (string)); +  return find_class_or_string_constant (cpool, CONSTANT_String, string); + +} +  /* Find (or create) a CONSTANT_NameAndType matching NAME and TYPE.     Return its index in the constant pool CPOOL. */ @@ -202,8 +214,7 @@ count_constant_pool_bytes (cpool)  {    int size = 2;    int i = 1; -  jword *datap = &cpool->data[1];; -  for ( ;  i < cpool->count;  i++, datap++) +  for ( ;  i < cpool->count;  i++)      {        size++;        switch (cpool->tags[i]) @@ -222,15 +233,19 @@ count_constant_pool_bytes (cpool)  	  break;  	case CONSTANT_Long:  	case CONSTANT_Double: -	  size += 4; +	  size += 8; +	  i++;  	  break;  	case CONSTANT_Utf8:  	  { -	    tree t = (tree) *datap; +	    tree t = (tree) cpool->data[i];  	    int len = IDENTIFIER_LENGTH (t);  	    size += len + 2;  	  }  	  break; +	default: +	  /* Second word of CONSTANT_Long and  CONSTANT_Double. */ +	  size--;  	}      }    return size; diff --git a/gcc/java/decl.c b/gcc/java/decl.c index 0831a37b89a..38b2badd28e 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -1482,7 +1482,8 @@ complete_start_java_method (fndecl)  #endif -  if (METHOD_STATIC (fndecl) && ! METHOD_PRIVATE (fndecl)) +  if (METHOD_STATIC (fndecl) && ! METHOD_PRIVATE (fndecl) +      && ! flag_emit_class_files)      {        tree clas = DECL_CONTEXT (fndecl);        tree init = build (CALL_EXPR, void_type_node, | 

