Commit e8fc7396 by Alexandre Petit-Bianco Committed by Alexandre Petit-Bianco

lang.c (lang_decode_option): Fixed returned value when parsing `-fxref=...' and `-Wall'.

Mon Apr 19 14:44:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* lang.c (lang_decode_option): Fixed returned value when parsing
 	`-fxref=...' and `-Wall'.
	* parse.y (source_end_java_method): Do not generate code when
 	flag_emit_xref is set.
	(resolve_expression_name): Do not build static field access when
 	flag_emit_xref is set.
	(resolve_field_access): No special treatement on `length' when
 	flag_emit_xref is set. Do not build qualified static field access
 	when flag_emit_xref is set.
	(patch_invoke): Keep the method DECL as operand 0 of the CALL_EXPR
 	when flag_emit_xref is set.
	(patch_assignment): Do not generate array store runtime check when
 	flag_emit_xref is set.
	* xref.c (xref_flag_value): Fixed function declaration
 	indentation.
	(xset_set_data): New function.
	* xref.h (xref_set_data): Added prototype for new function.
	(typedef struct xref_flag_table): New field data.
	(XREF_GET_DATA): New macro.

From-SVN: r26550
parent 3b6e1123
Mon Apr 19 14:44:48 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
* lang.c (lang_decode_option): Fixed returned value when parsing
`-fxref=...' and `-Wall'.
* parse.y (source_end_java_method): Do not generate code when
flag_emit_xref is set.
(resolve_expression_name): Do not build static field access when
flag_emit_xref is set.
(resolve_field_access): No special treatement on `length' when
flag_emit_xref is set. Do not build qualified static field access
when flag_emit_xref is set.
(patch_invoke): Keep the method DECL as operand 0 of the CALL_EXPR
when flag_emit_xref is set.
(patch_assignment): Do not generate array store runtime check when
flag_emit_xref is set.
* xref.c (xref_flag_value): Fixed function declaration
indentation.
(xset_set_data): New function.
* xref.h (xref_set_data): Added prototype for new function.
(typedef struct xref_flag_table): New field data.
(XREF_GET_DATA): New macro.
1999-04-19 Tom Tromey <tromey@cygnus.com> 1999-04-19 Tom Tromey <tromey@cygnus.com>
* xref.h (enum): Removed trailing comma. * xref.h (enum): Removed trailing comma.
...@@ -12,7 +34,7 @@ Thu Apr 15 13:08:03 1999 Anthony Green <green@cygnus.com> ...@@ -12,7 +34,7 @@ Thu Apr 15 13:08:03 1999 Anthony Green <green@cygnus.com>
Mon Apr 12 18:27:32 1999 Alexandre Petit-Bianco <apbianco@cygnus.com> Mon Apr 12 18:27:32 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (patch_unaryop): Fix ++ operator check on array * parse.y (patch_unaryop): Fixed ++/-- operator check on array
references. references.
Tue Apr 6 23:15:52 1999 Jeffrey A Law (law@cygnus.com) Tue Apr 6 23:15:52 1999 Jeffrey A Law (law@cygnus.com)
......
...@@ -177,9 +177,9 @@ lang_decode_option (argc, argv) ...@@ -177,9 +177,9 @@ lang_decode_option (argc, argv)
if (strncmp (p, XARG, sizeof (XARG) - 1) == 0) if (strncmp (p, XARG, sizeof (XARG) - 1) == 0)
{ {
if (!(flag_emit_xref = xref_flag_value (p + sizeof (XARG) - 1))) if (!(flag_emit_xref = xref_flag_value (p + sizeof (XARG) - 1)))
{
error ("Unkown xref format `%s'", p + sizeof (XARG) - 1); error ("Unkown xref format `%s'", p + sizeof (XARG) - 1);
} else
return 1;
} }
#undef XARG #undef XARG
...@@ -221,6 +221,7 @@ lang_decode_option (argc, argv) ...@@ -221,6 +221,7 @@ lang_decode_option (argc, argv)
flag_redundant = 1; flag_redundant = 1;
flag_not_overriding = 1; flag_not_overriding = 1;
flag_static_local_jdk1_1 = 1; flag_static_local_jdk1_1 = 1;
return 1;
} }
if (strcmp (p, "-MD") == 0) if (strcmp (p, "-MD") == 0)
......
...@@ -5488,7 +5488,8 @@ source_end_java_method () ...@@ -5488,7 +5488,8 @@ source_end_java_method ()
/* Generate function's code */ /* Generate function's code */
if (BLOCK_EXPR_BODY (DECL_FUNCTION_BODY (fndecl)) if (BLOCK_EXPR_BODY (DECL_FUNCTION_BODY (fndecl))
&& ! flag_emit_class_files) && ! flag_emit_class_files
&& ! flag_emit_xref)
expand_expr_stmt (BLOCK_EXPR_BODY (DECL_FUNCTION_BODY (fndecl))); expand_expr_stmt (BLOCK_EXPR_BODY (DECL_FUNCTION_BODY (fndecl)));
/* pop out of its parameters */ /* pop out of its parameters */
...@@ -5497,7 +5498,7 @@ source_end_java_method () ...@@ -5497,7 +5498,7 @@ source_end_java_method ()
BLOCK_SUPERCONTEXT (DECL_INITIAL (fndecl)) = fndecl; BLOCK_SUPERCONTEXT (DECL_INITIAL (fndecl)) = fndecl;
/* Generate rtl for function exit. */ /* Generate rtl for function exit. */
if (! flag_emit_class_files) if (! flag_emit_class_files && ! flag_emit_xref)
{ {
lineno = DECL_SOURCE_LINE_LAST (fndecl); lineno = DECL_SOURCE_LINE_LAST (fndecl);
/* Emit catch-finally clauses */ /* Emit catch-finally clauses */
...@@ -6091,7 +6092,7 @@ resolve_expression_name (id, orig) ...@@ -6091,7 +6092,7 @@ resolve_expression_name (id, orig)
/* Otherwise build what it takes to access the field */ /* Otherwise build what it takes to access the field */
decl = build_field_ref ((fs ? NULL_TREE : current_this), decl = build_field_ref ((fs ? NULL_TREE : current_this),
current_class, name); current_class, name);
if (fs && !flag_emit_class_files) if (fs && !flag_emit_class_files && !flag_emit_xref)
decl = build_class_init (current_class, decl); decl = build_class_init (current_class, decl);
/* We may be asked to save the real field access node */ /* We may be asked to save the real field access node */
if (orig) if (orig)
...@@ -6140,7 +6141,7 @@ resolve_field_access (qual_wfl, field_decl, field_type) ...@@ -6140,7 +6141,7 @@ resolve_field_access (qual_wfl, field_decl, field_type)
/* Resolve the LENGTH field of an array here */ /* Resolve the LENGTH field of an array here */
if (DECL_NAME (decl) == length_identifier_node && TYPE_ARRAY_P (type_found) if (DECL_NAME (decl) == length_identifier_node && TYPE_ARRAY_P (type_found)
&& ! flag_emit_class_files) && ! flag_emit_class_files && ! flag_emit_xref)
{ {
tree length = build_java_array_length_access (where_found); tree length = build_java_array_length_access (where_found);
field_ref = field_ref =
...@@ -6169,7 +6170,8 @@ resolve_field_access (qual_wfl, field_decl, field_type) ...@@ -6169,7 +6170,8 @@ resolve_field_access (qual_wfl, field_decl, field_type)
type_found, DECL_NAME (decl)); type_found, DECL_NAME (decl));
if (field_ref == error_mark_node) if (field_ref == error_mark_node)
return error_mark_node; return error_mark_node;
if (is_static && !static_final_found && !flag_emit_class_files) if (is_static && !static_final_found
&& !flag_emit_class_files && !flag_emit_xref)
{ {
field_ref = build_class_init (type_found, field_ref); field_ref = build_class_init (type_found, field_ref);
/* If the static field was identified by an expression that /* If the static field was identified by an expression that
...@@ -7011,7 +7013,7 @@ patch_invoke (patch, method, args) ...@@ -7011,7 +7013,7 @@ patch_invoke (patch, method, args)
TREE_TYPE (TREE_VALUE (ta)) != TREE_VALUE (t)) TREE_TYPE (TREE_VALUE (ta)) != TREE_VALUE (t))
TREE_VALUE (ta) = convert (TREE_VALUE (t), TREE_VALUE (ta)); TREE_VALUE (ta) = convert (TREE_VALUE (t), TREE_VALUE (ta));
if (flag_emit_class_files) if (flag_emit_class_files || flag_emit_xref)
func = method; func = method;
else else
{ {
...@@ -7057,7 +7059,7 @@ patch_invoke (patch, method, args) ...@@ -7057,7 +7059,7 @@ patch_invoke (patch, method, args)
{ {
tree class = DECL_CONTEXT (method); tree class = DECL_CONTEXT (method);
tree c1, saved_new, size, new; tree c1, saved_new, size, new;
if (flag_emit_class_files) if (flag_emit_class_files || flag_emit_xref)
{ {
TREE_TYPE (patch) = build_pointer_type (class); TREE_TYPE (patch) = build_pointer_type (class);
return patch; return patch;
...@@ -8654,6 +8656,7 @@ patch_assignment (node, wfl_op1, wfl_op2) ...@@ -8654,6 +8656,7 @@ patch_assignment (node, wfl_op1, wfl_op2)
/* 10.10: Array Store Exception runtime check */ /* 10.10: Array Store Exception runtime check */
if (!flag_emit_class_files if (!flag_emit_class_files
&& !flag_emit_xref
&& lvalue_from_array && lvalue_from_array
&& JREFERENCE_TYPE_P (TYPE_ARRAY_ELEMENT (lhs_type)) && JREFERENCE_TYPE_P (TYPE_ARRAY_ELEMENT (lhs_type))
&& !CLASS_FINAL (TYPE_NAME (GET_SKIP_TYPE (rhs_type)))) && !CLASS_FINAL (TYPE_NAME (GET_SKIP_TYPE (rhs_type))))
......
...@@ -40,7 +40,8 @@ static xref_flag_table xref_table [] = { ...@@ -40,7 +40,8 @@ static xref_flag_table xref_table [] = {
/* Decode an xref flag value. Return 0 if the flag wasn't found. */ /* Decode an xref flag value. Return 0 if the flag wasn't found. */
int xref_flag_value (flag) int
xref_flag_value (flag)
char *flag; char *flag;
{ {
int i; int i;
...@@ -50,6 +51,14 @@ int xref_flag_value (flag) ...@@ -50,6 +51,14 @@ int xref_flag_value (flag)
return 0; return 0;
} }
void
xref_set_data (flag, data)
int flag;
void *data;
{
xref_table [flag-1].data = data;
}
/* Branch to the right xref "back-end". */ /* Branch to the right xref "back-end". */
void void
......
...@@ -26,6 +26,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ ...@@ -26,6 +26,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
/* Exported functions. */ /* Exported functions. */
int xref_flag_value PROTO ((char *)); int xref_flag_value PROTO ((char *));
void expand_xref PROTO ((tree)); void expand_xref PROTO ((tree));
void xref_set_data PROTO ((int, void *));
/* flag_emit_xref range of possible values. */ /* flag_emit_xref range of possible values. */
...@@ -39,4 +40,7 @@ typedef struct { ...@@ -39,4 +40,7 @@ typedef struct {
char *key; /* Activator in -fxref=<key> */ char *key; /* Activator in -fxref=<key> */
void (*expand) PROTO ((FILE *, tree)); /* Function to write xrefs out */ void (*expand) PROTO ((FILE *, tree)); /* Function to write xrefs out */
FILE *fp; /* fp to use during the call. */ FILE *fp; /* fp to use during the call. */
void *data; /* Placeholder for additional data */
} xref_flag_table; } xref_flag_table;
#define XREF_GET_DATA(FLAG, T) ((T)xref_table [(FLAG)-1].data)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment