regcomp.c: Remove no longer used static function
authorKarl Williamson <khw@cpan.org>
Sun, 2 Dec 2018 20:53:20 +0000 (13:53 -0700)
committerKarl Williamson <khw@cpan.org>
Wed, 26 Dec 2018 19:50:37 +0000 (12:50 -0700)
embed.fnc
embed.h
proto.h
regcomp.c

index 3428217..d2a2ab3 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -2443,9 +2443,6 @@ Es        |U32    |join_exact     |NN RExC_state_t *pRExC_state \
                                |NN regnode *scan|NN UV *min_subtract  \
                                |NN bool *unfolded_multi_char          \
                                |U32 flags|NULLOK regnode *val|U32 depth
-Ei     |void   |alloc_maybe_populate_EXACT|NN RExC_state_t *pRExC_state \
-                               |NN regnode_offset node|NN I32 *flagp|STRLEN len \
-                               |UV code_point|bool downgradable
 Ein    |U8   |compute_EXACTish|NN RExC_state_t *pRExC_state
 Es     |void   |nextchar       |NN RExC_state_t *pRExC_state
 Es     |void   |skip_to_be_ignored_text|NN RExC_state_t *pRExC_state  \
diff --git a/embed.h b/embed.h
index 2ff99bf..d35508a 100644 (file)
--- a/embed.h
+++ b/embed.h
 #define add_cp_to_invlist(a,b) S_add_cp_to_invlist(aTHX_ a,b)
 #define add_data               S_add_data
 #define add_multi_match(a,b,c) S_add_multi_match(aTHX_ a,b,c)
-#define alloc_maybe_populate_EXACT(a,b,c,d,e,f)        S_alloc_maybe_populate_EXACT(aTHX_ a,b,c,d,e,f)
 #define change_engine_size(a,b)        S_change_engine_size(aTHX_ a,b)
 #define cntrl_to_mnemonic      S_cntrl_to_mnemonic
 #define compute_EXACTish       S_compute_EXACTish
diff --git a/proto.h b/proto.h
index c897268..2023f5c 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -5392,11 +5392,6 @@ STATIC U32       S_add_data(RExC_state_t* const pRExC_state, const char* const s, cons
 STATIC AV*     S_add_multi_match(pTHX_ AV* multi_char_matches, SV* multi_string, const STRLEN cp_count);
 #define PERL_ARGS_ASSERT_ADD_MULTI_MATCH       \
        assert(multi_string)
-#ifndef PERL_NO_INLINE_FUNCTIONS
-PERL_STATIC_INLINE void        S_alloc_maybe_populate_EXACT(pTHX_ RExC_state_t *pRExC_state, regnode_offset node, I32 *flagp, STRLEN len, UV code_point, bool downgradable);
-#define PERL_ARGS_ASSERT_ALLOC_MAYBE_POPULATE_EXACT    \
-       assert(pRExC_state); assert(node); assert(flagp)
-#endif
 STATIC void    S_change_engine_size(pTHX_ RExC_state_t *pRExC_state, const Ptrdiff_t size);
 #define PERL_ARGS_ASSERT_CHANGE_ENGINE_SIZE    \
        assert(pRExC_state)
index 5463d61..9ad1409 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -12963,169 +12963,6 @@ S_compute_EXACTish(RExC_state_t *pRExC_state)
     return op + EXACTF;
 }
 
-PERL_STATIC_INLINE void
-S_alloc_maybe_populate_EXACT(pTHX_ RExC_state_t *pRExC_state,
-                         regnode_offset node, I32* flagp, STRLEN len,
-                         UV code_point, bool downgradable)
-{
-    /* This knows the details about sizing an EXACTish node, setting flags for
-     * it (by setting <*flagp>, and potentially populating it with a single
-     * character.
-     *
-     * If <len> (the length in bytes) is non-zero, this function assumes that
-     * the node has already been populated, and just does the sizing.  In this
-     * case <code_point> should be the final code point that has already been
-     * placed into the node.  This value will be ignored except that under some
-     * circumstances <*flagp> is set based on it.
-     *
-     * If <len> is zero, the function assumes that the node is to contain only
-     * the single character given by <code_point> and calculates what <len>
-     * should be.  It populates the node's STRING with <code_point> or its
-     * fold if folding.
-     *
-     * In both cases <*flagp> is appropriately set
-     *
-     * It knows that under FOLD, the Latin Sharp S and UTF characters above
-     * 255, must be folded (the former only when the rules indicate it can
-     * match 'ss')
-     *
-     * When it does the populating, it looks at the flag 'downgradable'.  If
-     * true with a node that folds, it checks if the single code point
-     * participates in a fold, and if not downgrades the node to an EXACT.
-     * This helps the optimizer */
-
-    bool len_passed_in = cBOOL(len != 0);
-    U8 character[UTF8_MAXBYTES_CASE+1];
-
-    PERL_ARGS_ASSERT_ALLOC_MAYBE_POPULATE_EXACT;
-
-    if (! len_passed_in) {
-        if (UTF) {
-            if (UVCHR_IS_INVARIANT(code_point)) {
-                if (LOC || ! FOLD) {    /* /l defers folding until runtime */
-                    *character = (U8) code_point;
-                }
-                else { /* Here is /i and not /l. */
-                    *character = toFOLD((U8) code_point);
-
-                    /* We can downgrade to an EXACT node if this character
-                     * isn't a folding one.  Note that this assumes that
-                     * nothing above Latin1 folds to some other invariant than
-                     * one of these alphabetics; otherwise we would also have
-                     * to check:
-                     *  && (! HAS_NONLATIN1_FOLD_CLOSURE(code_point)
-                     *      || ASCII_FOLD_RESTRICTED))
-                     */
-                    if (downgradable && PL_fold[code_point] == code_point) {
-                        OP(REGNODE_p(node)) = EXACT;
-                    }
-                }
-                len = 1;
-            }
-            else if (FOLD && (   ! LOC
-                              || ! is_PROBLEMATIC_LOCALE_FOLD_cp(code_point)))
-            {   /* Folding, and ok to do so now */
-                UV folded = _to_uni_fold_flags(
-                                   code_point,
-                                   character,
-                                   &len,
-                                   FOLD_FLAGS_FULL | ((ASCII_FOLD_RESTRICTED)
-                                                      ? FOLD_FLAGS_NOMIX_ASCII
-                                                      : 0));
-                if (downgradable
-                    && folded == code_point /* This quickly rules out many
-                                               cases, avoiding the
-                                               _invlist_contains_cp() overhead
-                                               for those.  */
-                    && ! _invlist_contains_cp(PL_in_some_fold, code_point))
-                {
-                    OP(REGNODE_p(node)) = (LOC)
-                               ? EXACTL
-                               : EXACT;
-                }
-            }
-            else if (code_point <= MAX_UTF8_TWO_BYTE) {
-
-                /* Not folding this cp, and can output it directly */
-                *character = UTF8_TWO_BYTE_HI(code_point);
-                *(character + 1) = UTF8_TWO_BYTE_LO(code_point);
-                len = 2;
-            }
-            else {
-                uvchr_to_utf8( character, code_point);
-                len = UTF8SKIP(character);
-            }
-        } /* Else pattern isn't UTF8.  */
-        else if (! FOLD) {
-            *character = (U8) code_point;
-            len = 1;
-        } /* Else is folded non-UTF8 */
-#if    UNICODE_MAJOR_VERSION > 3 /* no multifolds in early Unicode */   \
-   || (UNICODE_MAJOR_VERSION == 3 && (   UNICODE_DOT_VERSION > 0)       \
-                                      || UNICODE_DOT_DOT_VERSION > 0)
-        else if (LIKELY(code_point != LATIN_SMALL_LETTER_SHARP_S)) {
-#else
-        else if (1) {
-#endif
-            *character = (U8) (DEPENDS_SEMANTICS)
-                              ? toFOLD(code_point)
-                              : (LOC)
-                                ? code_point
-                                : toLOWER_L1(code_point);
-            len = 1;
-
-            /* Can turn into an EXACT node if we know the fold at compile time,
-             * and it folds to itself and doesn't particpate in other folds */
-            if (downgradable
-                && ! LOC
-                && PL_fold_latin1[code_point] == code_point
-                && (! HAS_NONLATIN1_FOLD_CLOSURE(code_point)
-                    || (isASCII(code_point) && ASCII_FOLD_RESTRICTED)))
-            {
-                OP(REGNODE_p(node)) = EXACT;
-            }
-        } /* else is Sharp s.  May need to fold it */
-        else if (AT_LEAST_UNI_SEMANTICS && ! ASCII_FOLD_RESTRICTED) {
-            *character = 's';
-            *(character + 1) = 's';
-            len = 2;
-        }
-        else {
-            *character = LATIN_SMALL_LETTER_SHARP_S;
-            len = 1;
-        }
-    }
-
-    if (downgradable) {
-        change_engine_size(pRExC_state, STR_SZ(len));
-    }
-
-    RExC_emit += STR_SZ(len);
-    STR_LEN(REGNODE_p(node)) = len;
-    if (! len_passed_in) {
-        Copy((char *) character, STRING(REGNODE_p(node)), len, char);
-    }
-
-    *flagp |= HASWIDTH;
-
-    /* A single character node is SIMPLE, except for the special-cased SHARP S
-     * under /di. */
-    if ((len == 1 || (UTF && len == UVCHR_SKIP(code_point)))
-#if    UNICODE_MAJOR_VERSION > 3 /* no multifolds in early Unicode */   \
-   || (UNICODE_MAJOR_VERSION == 3 && (   UNICODE_DOT_VERSION > 0)       \
-                                      || UNICODE_DOT_DOT_VERSION > 0)
-        && ( code_point != LATIN_SMALL_LETTER_SHARP_S
-            || ! FOLD || ! DEPENDS_SEMANTICS)
-#endif
-    ) {
-        *flagp |= SIMPLE;
-    }
-
-    if (OP(REGNODE_p(node)) == EXACTFL) {
-        RExC_contains_locale = 1;
-    }
-}
-
 STATIC bool
 S_new_regcurly(const char *s, const char *e)
 {