diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-12-10 04:37:58 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-12-10 04:37:58 +0000 |
commit | 5cf1ec52565b19d68c3c0fbd853c0b5de26b27b2 (patch) | |
tree | c93f9b9778da05c5d67f29870f1e263963e64ef5 /posix/regex_internal.h | |
parent | dc165f7b0bfa73ebd64584331d0cb7c2ead66147 (diff) | |
download | glibc-5cf1ec52565b19d68c3c0fbd853c0b5de26b27b2.tar.gz glibc-5cf1ec52565b19d68c3c0fbd853c0b5de26b27b2.tar.xz glibc-5cf1ec52565b19d68c3c0fbd853c0b5de26b27b2.zip |
Update.
2004-12-07 Paolo Bonzini <bonzini@gnu.org> * posix/regexec.c (proceed_next_node): Simplify treatment of epsilon nodes. Pass the pushed node to push_fail_stack. (push_fail_stack): Accept a single node rather than an array of two epsilon destinations. (build_sifted_states): Only walk non-epsilon nodes. (check_arrival): Don't pass epsilon nodes to check_arrival_add_next_nodes. (check_arrival_add_next_nodes) [DEBUG]: Abort if an epsilon node is found. (check_node_accept): Do expensive checks later. (add_epsilon_src_nodes): Cache result of merging the inveclosures. * posix/regex_internal.h (re_dfastate_t): Add non_eps_nodes and inveclosure. (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at, re_string_context_at, re_string_peek_byte_case, re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains): Declare as pure. * posix/regex_internal.c (create_newstate_common): Remove. (register_state): Move part of it here. Initialize non_eps_nodes. (free_state): Free inveclosure and non_eps_nodes. (create_cd_newstate, create_ci_newstate): Allocate the new re_dfastate_t here.
Diffstat (limited to 'posix/regex_internal.h')
-rw-r--r-- | posix/regex_internal.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/posix/regex_internal.h b/posix/regex_internal.h index 1345067a89..0ccd8d3665 100644 --- a/posix/regex_internal.h +++ b/posix/regex_internal.h @@ -388,18 +388,20 @@ static void re_string_translate_buffer (re_string_t *pstr) internal_function; static void re_string_destruct (re_string_t *pstr) internal_function; # ifdef RE_ENABLE_I18N static int re_string_elem_size_at (const re_string_t *pstr, int idx) - internal_function; + internal_function __attribute ((pure)); static inline int re_string_char_size_at (const re_string_t *pstr, int idx) - internal_function; + internal_function __attribute ((pure)); static inline wint_t re_string_wchar_at (const re_string_t *pstr, int idx) - internal_function; + internal_function __attribute ((pure)); # endif /* RE_ENABLE_I18N */ static unsigned int re_string_context_at (const re_string_t *input, int idx, - int eflags) internal_function; + int eflags) + internal_function __attribute ((pure)); static unsigned char re_string_peek_byte_case (const re_string_t *pstr, - int idx) internal_function; + int idx) + internal_function __attribute ((pure)); static unsigned char re_string_fetch_byte_case (re_string_t *pstr) - internal_function; + internal_function __attribute ((pure)); #endif #define re_string_peek_byte(pstr, offset) \ ((pstr)->mbs[(pstr)->cur_idx + offset]) @@ -481,6 +483,8 @@ struct re_dfastate_t { unsigned int hash; re_node_set nodes; + re_node_set non_eps_nodes; + re_node_set inveclosure; re_node_set *entrance_nodes; struct re_dfastate_t **trtable; unsigned int context : 4; @@ -665,8 +669,10 @@ static int re_node_set_insert (re_node_set *set, int elem) internal_function; static int re_node_set_insert_last (re_node_set *set, int elem) internal_function; static int re_node_set_compare (const re_node_set *set1, - const re_node_set *set2) internal_function; -static int re_node_set_contains (const re_node_set *set, int elem) internal_function; + const re_node_set *set2) + internal_function __attribute ((pure)); +static int re_node_set_contains (const re_node_set *set, int elem) + internal_function __attribute ((pure)); static void re_node_set_remove_at (re_node_set *set, int idx) internal_function; #define re_node_set_remove(set,id) \ (re_node_set_remove_at (set, re_node_set_contains (set, id) - 1)) |