parse.y (process_imports): Save the original name of the import for better error report.

2001-02-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>

        * parse.y (process_imports): Save the original name of the import
        for better error report.

(http://gcc.gnu.org/ml/gcc-patches/2001-02/msg00250.html)

From-SVN: r39461
This commit is contained in:
Alexandre Petit-Bianco 2001-02-05 18:09:45 +00:00 committed by Alexandre Petit-Bianco
parent 518fed76bc
commit 1ebb5e73d6
2 changed files with 15 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2001-02-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (process_imports): Save the original name of the import
for better error report.
2001-02-04 Bryce McKinlay <bryce@albatross.co.nz> 2001-02-04 Bryce McKinlay <bryce@albatross.co.nz>
* Make-lang.in (jvspec.o): Add DRIVER_DEFINES to the list * Make-lang.in (jvspec.o): Add DRIVER_DEFINES to the list

View File

@ -6411,6 +6411,12 @@ process_imports ()
for (import = ctxp->import_list; import; import = TREE_CHAIN (import)) for (import = ctxp->import_list; import; import = TREE_CHAIN (import))
{ {
tree to_be_found = EXPR_WFL_NODE (TREE_PURPOSE (import)); tree to_be_found = EXPR_WFL_NODE (TREE_PURPOSE (import));
char *original_name;
obstack_grow0 (&temporary_obstack,
IDENTIFIER_POINTER (to_be_found),
IDENTIFIER_LENGTH (to_be_found));
original_name = obstack_finish (&temporary_obstack);
/* Don't load twice something already defined. */ /* Don't load twice something already defined. */
if (IDENTIFIER_CLASS_VALUE (to_be_found)) if (IDENTIFIER_CLASS_VALUE (to_be_found))
@ -6442,9 +6448,11 @@ process_imports ()
{ {
parse_error_context (TREE_PURPOSE (import), parse_error_context (TREE_PURPOSE (import),
"Class or interface `%s' not found in import", "Class or interface `%s' not found in import",
IDENTIFIER_POINTER (to_be_found)); original_name);
return 1; error_found = 1;
} }
obstack_free (&temporary_obstack, original_name);
if (error_found) if (error_found)
return 1; return 1;
} }