mirror of
https://git.savannah.gnu.org/git/gperf.git
synced 2025-12-02 21:19:24 +00:00
Omit the multicompare code output if it is not needed.
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
2003-01-01 Bruno Haible <bruno@clisp.org>
|
2003-01-01 Bruno Haible <bruno@clisp.org>
|
||||||
|
|
||||||
|
* src/output.cc (Output::output_lookup_function_body): Omit the
|
||||||
|
multicompare code section and its variables when it is not used.
|
||||||
|
* tests/chill.exp: Regenerated.
|
||||||
|
|
||||||
* src/output.c (Output_Compare::output_firstchar_comparison): New
|
* src/output.c (Output_Compare::output_firstchar_comparison): New
|
||||||
method.
|
method.
|
||||||
(Output_Compare_Strcmp::output_comparison,
|
(Output_Compare_Strcmp::output_comparison,
|
||||||
|
|||||||
@@ -1334,7 +1334,7 @@ Output::output_lookup_function_body (const Output_Compare& comparison) const
|
|||||||
|
|
||||||
printf (" if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)\n"
|
printf (" if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)\n"
|
||||||
" {\n");
|
" {\n");
|
||||||
if (option[DUP])
|
if (option[DUP] && _total_duplicates > 0)
|
||||||
{
|
{
|
||||||
if (option[LENTABLE])
|
if (option[LENTABLE])
|
||||||
printf (" register %s%s *lengthptr;\n",
|
printf (" register %s%s *lengthptr;\n",
|
||||||
@@ -1358,7 +1358,7 @@ Output::output_lookup_function_body (const Output_Compare& comparison) const
|
|||||||
|
|
||||||
output_switches (_head, num_switches, switch_size, _min_hash_value, _max_hash_value, 10);
|
output_switches (_head, num_switches, switch_size, _min_hash_value, _max_hash_value, 10);
|
||||||
|
|
||||||
if (option[DUP])
|
if (option[DUP] && _total_duplicates > 0)
|
||||||
{
|
{
|
||||||
int indent = 8;
|
int indent = 8;
|
||||||
printf ("%*s return 0;\n"
|
printf ("%*s return 0;\n"
|
||||||
|
|||||||
@@ -446,8 +446,6 @@ in_word_set (str, len)
|
|||||||
|
|
||||||
if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
|
if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
|
||||||
{
|
{
|
||||||
register struct resword *wordptr;
|
|
||||||
register struct resword *wordendptr;
|
|
||||||
register struct resword *resword;
|
register struct resword *resword;
|
||||||
|
|
||||||
switch (key - 4)
|
switch (key - 4)
|
||||||
@@ -1354,16 +1352,6 @@ in_word_set (str, len)
|
|||||||
goto compare;
|
goto compare;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
multicompare:
|
|
||||||
while (wordptr < wordendptr)
|
|
||||||
{
|
|
||||||
register const char *s = wordptr->name;
|
|
||||||
|
|
||||||
if (*str == *s && !strcmp (str + 1, s + 1))
|
|
||||||
return wordptr;
|
|
||||||
wordptr++;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
compare:
|
compare:
|
||||||
{
|
{
|
||||||
register const char *s = resword->name;
|
register const char *s = resword->name;
|
||||||
|
|||||||
Reference in New Issue
Block a user