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] | |
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.
Also, we need a more descriptive name than "lang_record_type" for this struct. Perhaps sorted_fields_type?
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.
Attachment:
fixPR10962.diff
Description: Binary data
Thanks, Andrew Pinski
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |