diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-12-07 22:05:59 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-12-07 22:05:59 +0000 |
commit | b735cc56a2aab6b3a1c22f0521a1d607a36e5a61 (patch) | |
tree | 4c4b018e43b3666acb5b9a2b111beb302182fae9 /libcpp | |
parent | 5f72d880cad044ccc5f0e24a55168a95ef4a667d (diff) | |
download | gcc-b735cc56a2aab6b3a1c22f0521a1d607a36e5a61.tar.gz |
PR bootstrap/50237
* internal.h (_cpp_init_lexer): New prototype.
* init.c (init_library): Call it.
* lex.c (init_vectorized_lexer): Remove constructor attribute,
add inline keyword.
(HAVE_init_vectorized_lexer): Define.
(_cpp_init_lexer): New function.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182090 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/ChangeLog | 10 | ||||
-rw-r--r-- | libcpp/init.c | 2 | ||||
-rw-r--r-- | libcpp/internal.h | 1 | ||||
-rw-r--r-- | libcpp/lex.c | 13 |
4 files changed, 25 insertions, 1 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index f47bf03a341..890075db64d 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,13 @@ +2011-12-07 Jakub Jelinek <jakub@redhat.com> + + PR bootstrap/50237 + * internal.h (_cpp_init_lexer): New prototype. + * init.c (init_library): Call it. + * lex.c (init_vectorized_lexer): Remove constructor attribute, + add inline keyword. + (HAVE_init_vectorized_lexer): Define. + (_cpp_init_lexer): New function. + 2011-12-03 Dodji Seketeli <dodji@redhat.com> * macro.c (tokens_buff_remove_last_token) diff --git a/libcpp/init.c b/libcpp/init.c index 9101b34e086..ff006b11502 100644 --- a/libcpp/init.c +++ b/libcpp/init.c @@ -134,6 +134,8 @@ init_library (void) { initialized = 1; + _cpp_init_lexer (); + /* Set up the trigraph map. This doesn't need to do anything if we were compiled with a compiler that supports C99 designated initializers. */ diff --git a/libcpp/internal.h b/libcpp/internal.h index b3dc2df10bf..7e2932a6035 100644 --- a/libcpp/internal.h +++ b/libcpp/internal.h @@ -653,6 +653,7 @@ extern int _cpp_equiv_tokens (const cpp_token *, const cpp_token *); extern void _cpp_init_tokenrun (tokenrun *, unsigned int); extern cpp_hashnode *_cpp_lex_identifier (cpp_reader *, const char *); extern int _cpp_remaining_tokens_num_in_context (cpp_context *); +extern void _cpp_init_lexer (void); /* In init.c. */ extern void _cpp_maybe_push_include_file (cpp_reader *); diff --git a/libcpp/lex.c b/libcpp/lex.c index fcec329d8b4..0ad9660a76b 100644 --- a/libcpp/lex.c +++ b/libcpp/lex.c @@ -477,7 +477,8 @@ search_line_sse42 (const uchar *s, const uchar *end) typedef const uchar * (*search_line_fast_type) (const uchar *, const uchar *); static search_line_fast_type search_line_fast; -static void __attribute__((constructor)) +#define HAVE_init_vectorized_lexer 1 +static inline void init_vectorized_lexer (void) { unsigned dummy, ecx = 0, edx = 0; @@ -638,6 +639,16 @@ search_line_fast (const uchar *s, const uchar *end ATTRIBUTE_UNUSED) #endif +/* Initialize the lexer if needed. */ + +void +_cpp_init_lexer (void) +{ +#ifdef HAVE_init_vectorized_lexer + init_vectorized_lexer (); +#endif +} + /* Returns with a logical line that contains no escaped newlines or trigraphs. This is a time-critical inner loop. */ void |