Hardcode regex syntax to remove dead code handling different syntax
Emacs only ever uses its own regex syntax so support for other syntaxes
is never used. Hardcode the syntax so that the compilar can detect such
dead code and remove it from compiled code.
The only exception is RE_NO_POSIX_BACKTRACKING which can be separatelly
specified. Handle this separatelly with a function argument (replacing
now unnecessary syntax argument).
With this patchset, size of Emacs binary on x86_64 machine is reduced by
around 60 kB:
new-sizes:-rwx------ 3 mpn eng
30254720 Jul 27 23:31 src/emacs
old-sizes:-rwx------ 3 mpn eng
30314828 Jul 27 23:29 src/emacs
* src/regex.h (re_pattern_buffer): Don’t define syntax field #ifdef emacs.
(re_compile_pattern): Replace syntax with posix_backtracking argument.
* src/regex.c (print_compiled_pattern): Don’t print syntax #ifdef emacs.
(regex_compile): #ifdef emacs, replace syntax argument with
posix_backtracking which is now used instead of testing for
RE_NO_POSIX_BACKTRACKING syntax.
(re_match_2_internal): Don’t access bufp->syntax #ifndef emacs.
(re_compile_pattern): Replace syntax with posix_backtracking argument.
* src/search.c (compile_pattern_1): Pass boolean posix_backtracking
instead of syntax to re_compile_pattern.