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] | |
This patch speeds up a couple of paths in the C++ parser's handling of 'enum' declarations/definitions. These have fairly restricted syntax, so it is possible to replace the backtracking that was being done with a two-token lookahead. More significantly, build_enumerator was constructing an ADD_EXPR just to fold it out again. It's much faster to call add_double and int_fits_type_p directly.
I should note that C also has the same problem with respect of constructing an PLUS_EXPR and folding it back. When I just made this change I found that most of the created expressions for a file with an enumeration did not get created but I also found that it did not help compile time speed at all.
Thanks, Andrew Pinski
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |