From: Alexandre Petit-Bianco Date: Thu, 26 Aug 1999 16:51:49 +0000 (+0000) Subject: re GNATS gcj/32 (A boolean expression containing two qualified expressions makes... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f441f67120fc98b943b4f9d39a759404afc7032c;p=platform%2Fupstream%2Fgcc.git re GNATS gcj/32 (A boolean expression containing two qualified expressions makes jc1 die.) Thu Aug 26 09:10:58 1999 Alexandre Petit-Bianco * parse.y (lookup_cl): Changed leading comment. Now does its best to set the column number. (qualify_ambiguous_name): Take WFL wrappers into account. This patch fixes the Java net PR #32. From-SVN: r28894 --- diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index d30c891..3803691 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,9 @@ +Thu Aug 26 09:10:58 1999 Alexandre Petit-Bianco + + * parse.y (lookup_cl): Changed leading comment. Now does its best + to set the column number. + (qualify_ambiguous_name): Take WFL wrappers into account. + 1999-08-25 Tom Tromey * jvspec.c (lang_specific_driver): Correctly handle --help again. diff --git a/gcc/java/parse.c b/gcc/java/parse.c index 34b1da4..5d999a4 100644 --- a/gcc/java/parse.c +++ b/gcc/java/parse.c @@ -2235,7 +2235,7 @@ static const short yycheck[] = { 3, #define YYPURE 1 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/local/gnu/share/bison.simple" +#line 3 "/usr/share/misc/bison.simple" /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. @@ -2252,7 +2252,7 @@ static const short yycheck[] = { 3, You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. @@ -2386,8 +2386,10 @@ int yydebug; /* nonzero means print parse trace */ /* Prevent warning if -Wstrict-prototypes. */ #ifdef __GNUC__ +#ifndef YYPARSE_PARAM int yyparse (void); #endif +#endif #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) @@ -2428,7 +2430,7 @@ __yy_memcpy (char *to, char *from, int count) #endif #endif -#line 196 "/usr/local/gnu/share/bison.simple" +#line 196 "/usr/share/misc/bison.simple" /* The user can define YYPARSE_PARAM as the name of an argument to be passed into yyparse. The argument should have type void *. @@ -4717,7 +4719,7 @@ case 495: break;} } /* the action file gets copied in in place of this dollarsign */ -#line 498 "/usr/local/gnu/share/bison.simple" +#line 498 "/usr/share/misc/bison.simple" yyvsp -= yylen; yyssp -= yylen; @@ -7684,14 +7686,15 @@ lookup_java_method2 (clas, method_decl, do_interface) return NULL_TREE; } -/* Return the line that matches DECL line number. Used during error - report */ +/* Return the line that matches DECL line number, and try its best to + position the column number. Used during error reports. */ static tree lookup_cl (decl) tree decl; { static tree cl = NULL_TREE; + char *line, *found; if (!decl) return NULL_TREE; @@ -7702,6 +7705,14 @@ lookup_cl (decl) EXPR_WFL_FILENAME_NODE (cl) = get_identifier (DECL_SOURCE_FILE (decl)); EXPR_WFL_SET_LINECOL (cl, DECL_SOURCE_LINE_FIRST (decl), -1); + line = java_get_line_col (IDENTIFIER_POINTER (EXPR_WFL_FILENAME_NODE (cl)), + EXPR_WFL_LINENO (cl), EXPR_WFL_COLNO (cl)); + + found = strstr ((const char *)line, + (const char *)IDENTIFIER_POINTER (DECL_NAME (decl))); + if (found) + EXPR_WFL_SET_LINECOL (cl, EXPR_WFL_LINENO (cl), found - line); + return cl; } @@ -10446,8 +10457,15 @@ qualify_ambiguous_name (id) again = 1; } else - name = EXPR_WFL_NODE (qual_wfl); - + { + name = EXPR_WFL_NODE (qual_wfl); + if (!name) + { + qual = EXPR_WFL_QUALIFICATION (qual_wfl); + again = 1; + } + } + /* If we have a THIS (from a primary), we set the context accordingly */ if (name == this_identifier_node) { diff --git a/gcc/java/parse.y b/gcc/java/parse.y index a758f75..469105e 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -5099,14 +5099,15 @@ lookup_java_method2 (clas, method_decl, do_interface) return NULL_TREE; } -/* Return the line that matches DECL line number. Used during error - report */ +/* Return the line that matches DECL line number, and try its best to + position the column number. Used during error reports. */ static tree lookup_cl (decl) tree decl; { static tree cl = NULL_TREE; + char *line, *found; if (!decl) return NULL_TREE; @@ -5117,6 +5118,14 @@ lookup_cl (decl) EXPR_WFL_FILENAME_NODE (cl) = get_identifier (DECL_SOURCE_FILE (decl)); EXPR_WFL_SET_LINECOL (cl, DECL_SOURCE_LINE_FIRST (decl), -1); + line = java_get_line_col (IDENTIFIER_POINTER (EXPR_WFL_FILENAME_NODE (cl)), + EXPR_WFL_LINENO (cl), EXPR_WFL_COLNO (cl)); + + found = strstr ((const char *)line, + (const char *)IDENTIFIER_POINTER (DECL_NAME (decl))); + if (found) + EXPR_WFL_SET_LINECOL (cl, EXPR_WFL_LINENO (cl), found - line); + return cl; } @@ -7861,8 +7870,15 @@ qualify_ambiguous_name (id) again = 1; } else - name = EXPR_WFL_NODE (qual_wfl); - + { + name = EXPR_WFL_NODE (qual_wfl); + if (!name) + { + qual = EXPR_WFL_QUALIFICATION (qual_wfl); + again = 1; + } + } + /* If we have a THIS (from a primary), we set the context accordingly */ if (name == this_identifier_node) {