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: [PATH] fix c/10962, slow lookup_field


I forgot to say bootstrapped fine on powerpc-apple-darwin6.6
and on i686-unknown-openbsd3.1 (no regressions here).
And on i686-pc-linux-gnu with no regressions.

Thanks,
Andrew Pinski

On Friday, May 30, 2003, at 17:11 US/Eastern, Andrew Pinski wrote:

Thanks again Jason for looking this patch over.

On Friday, May 30, 2003, at 11:33 US/Eastern, Jason Merrill wrote:

Thanks, almost there.

I wouldn't bother with the DECL_DECLARES_TYPE_NON_TEMPLATE_P macro; it
doesn't make the code any clearer. Just write the test directly in the
function.

Okay I did that.



Also, we need a more descriptive name than "lang_record_type" for this struct. Perhaps sorted_fields_type?

That seems like a good idea.



Don't add another blank line before struct lang_type.

Woops, I tried to make sure there were no extra blank lines in there when I moved the code around.

I also removed the `char*' crap from finish_struct in c-decl.c which was
there because of I had copied the old code from cvs and I had not gone
and updated it to C90, so no more excess casting.


ChangeLog:
2003-05-30  Andrew Pinski  <pinskia@physics.uc.edu>

	* ggc.h: Add header guards.
	* c-decl.c (finish_struct): Sort fields if
	number greater than 15 and there are no
	anonymous structs/unions.
	* c-common.h: Include ggc.h.
	(sorted_fields_type): New struct.
	(field_decl_cmp): New prototype.
	(resort_sorted_fields): New prototype.
	(DECL_DECLARES_TYPE_NON_TEMPLATE_P): New macro.
	* c-tree.h: (lang_type): Use pointer to sorted_fields_type
	as s, removing other fields.
	* c-typeck.c (lookup_field): Use s in lang_type.
These were mostly moved from cp/class.c:
	* c-common.c (field_decl_cmp): New static function.
	(field_decl_cmp): New function.
	(resort_sorted_fields): New function.


cp/ChangeLog: 2003-05-30 Andrew Pinski <pinskia@physics.uc.edu>

	* class.c (field_decl_cmp): Remove.
	(resort_field_decl_cmp): Remove.
	(resort_sorted_fields): Remove.
	(add_fields_to_vec): Rename to ...
	(add_fields_to_record_type): this.
	(finish_struct_1): Change to be using
	sorted_fields_type's fields.
	* cp-tree.h (lang_decl): In lang_decl_u3
	change sorted_fields to be a pointer to
	sorted_fields_type.
	(resort_sorted_fields): Remove prototype.
	* search.c (lookup_field_1): Change to be using
	sorted_fields_type's fields.

Patch:
<fixPR10962.diff>


Thanks, Andrew Pinski


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