From 092da96ac4fc1bfa4c794320f538edb4e8d4fcfd Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 3 Apr 2019 11:28:17 +1030 Subject: [PATCH] ldlex.l tidy Underscore was specified twice in all these patterns, and backslash twice in some. Flex warned about the $SYSROOT rule, which is covered by earlier rules: "ldlex.l:386: warning, rule cannot be matched". * ldlex.l: Formatting. (CMDFILENAMECHAR, CMDFILENAMECHAR1): Delete. (FILENAMECHAR1, SYMBOLNAMECHAR1, FILENAMECHAR, WILDCHAR), (NOCFILENAMECHAR): Remove duplicate chars. Reorder. (SYMBOLCHARN): Likewise. Rename to SYMBOLNAMECHAR. ("$SYSROOT"..): Delete rule. --- ld/ChangeLog | 9 +++++++++ ld/ldlex.l | 33 +++++++++++++-------------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index b987a13edb7..851bffbe86f 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,12 @@ +2019-04-03 Alan Modra + + * ldlex.l: Formatting. + (CMDFILENAMECHAR, CMDFILENAMECHAR1): Delete. + (FILENAMECHAR1, SYMBOLNAMECHAR1, FILENAMECHAR, WILDCHAR), + (NOCFILENAMECHAR): Remove duplicate chars. Reorder. + (SYMBOLCHARN): Likewise. Rename to SYMBOLNAMECHAR. + ("$SYSROOT"..): Delete rule. + 2019-03-29 Max Filippov * testsuite/ld-xtensa/relax-undef-weak-pie-export-dynamic.d: New diff --git a/ld/ldlex.l b/ld/ldlex.l index a7bf04c1ff2..6e73a7fb65b 100644 --- a/ld/ldlex.l +++ b/ld/ldlex.l @@ -91,17 +91,14 @@ static void lex_warn_invalid (char *where, char *what); %a 4000 %o 5000 -CMDFILENAMECHAR [_a-zA-Z0-9\/\.\\_\+\$\:\[\]\\\,\=\&\!\<\>\-\~] -CMDFILENAMECHAR1 [_a-zA-Z0-9\/\.\\_\+\$\:\[\]\\\,\=\&\!\<\>\~] -FILENAMECHAR1 [_a-zA-Z\/\.\\\$\_\~] -SYMBOLNAMECHAR1 [_a-zA-Z\/\.\\\$\_] -SYMBOLCHARN [_a-zA-Z\/\.\\\$\_\~0-9] -FILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~] -WILDCHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~\?\*\^\!] +WILDCHAR [_a-zA-Z0-9\/\.\\\$\~\-\+\:\[\]\,\=\?\*\^\!] +FILENAMECHAR [_a-zA-Z0-9\/\.\\\$\~\-\+\:\[\]\,\=] +NOCFILENAMECHAR [_a-zA-Z0-9\/\.\\\$\~\-\+\:\[\]] +SYMBOLNAMECHAR [_a-zA-Z0-9\/\.\\\$\~] +FILENAMECHAR1 [_a-zA-Z\/\.\\\$\~] +SYMBOLNAMECHAR1 [_a-zA-Z\/\.\\\$] WHITE [ \t\n\r]+ -NOCFILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~] - V_TAG [.$_a-zA-Z][._a-zA-Z0-9]* V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* @@ -137,7 +134,8 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* "-" { RTOKEN('-');} "+" { RTOKEN('+');} -{SYMBOLNAMECHAR1}{SYMBOLCHARN}* { yylval.name = xstrdup (yytext); return NAME; } +{SYMBOLNAMECHAR1}{SYMBOLNAMECHAR}* { yylval.name = xstrdup (yytext); + return NAME; } "=" { RTOKEN('='); } "$"([0-9A-Fa-f])+ { @@ -368,31 +366,26 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* {FILENAMECHAR1}{NOCFILENAMECHAR}* { /* Filename without commas, needed to parse mri stuff */ - yylval.name = xstrdup (yytext); + yylval.name = xstrdup (yytext); return NAME; } {FILENAMECHAR1}{FILENAMECHAR}* { - yylval.name = xstrdup (yytext); + yylval.name = xstrdup (yytext); return NAME; } "="{FILENAMECHAR1}{FILENAMECHAR}* { /* Filename to be prefixed by --sysroot or when non-sysrooted, nothing. */ - yylval.name = xstrdup (yytext); - return NAME; - } -"$SYSROOT"{FILENAMECHAR1}{FILENAMECHAR}* { -/* Filename to be prefixed by --sysroot or when non-sysrooted, nothing. */ - yylval.name = xstrdup (yytext); + yylval.name = xstrdup (yytext); return NAME; } "-l"{FILENAMECHAR}+ { yylval.name = xstrdup (yytext + 2); return LNAME; } -{SYMBOLNAMECHAR1}{NOCFILENAMECHAR}* { - yylval.name = xstrdup (yytext); +{SYMBOLNAMECHAR1}{NOCFILENAMECHAR}* { + yylval.name = xstrdup (yytext); return NAME; } "-l"{NOCFILENAMECHAR}+ {