summaryrefslogtreecommitdiff
path: root/gcc/cp/error.c
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-30 18:23:35 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-30 18:23:35 +0000
commit357f7efa28215866eb65169d37697276dd63f8bb (patch)
treebee4190e15fa75923831305a97d15dbe3638b99e /gcc/cp/error.c
parent512e0fec202bedd46efc579717091ad3e79e514b (diff)
downloadgcc-357f7efa28215866eb65169d37697276dd63f8bb.tar.gz
Conditionally compile support for --enable-mapped_location.
* decl.c (pop_label): Handle (imperfectly) USE_MAPPED_LOCATION case. * decl2.c: If USE_MAPPED_LOCATION, don't do some line number adjustments - which I don't understand. * error.c (dump_decl): Rename "<interrnal>" to "<built-in>". * error.c: Use LOCATION_FILE and EXPR_LOCATION macros. (print_instantiation_partial_context): Use expand_location. * decl.c (duplicate_decl): Use new DECL_IS_BUILTIN macro. * name-lookup.c: Likewise. * lex.c (cxx_init): Likewise. Also use BUILTINS_LOCATION. * name-lookup.c: Use input_line macro. * parser.c (cp_lexer_get_preprocessor_token): Use UNKNOWN_LOCATION. (cp_parser_statement): Rename locaal variable statement_locus to statement_location and use SET_EXPR_LOCATION macro. * pt.c: Handle USE_MAPPED_LOCATION case. Use new macros. * tree.c (cp_walk_subtrees): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83923 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r--gcc/cp/error.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 2c34e667838..e345793f3c7 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -835,7 +835,7 @@ dump_decl (tree t, int flags)
if (DECL_GLOBAL_CTOR_P (t) || DECL_GLOBAL_DTOR_P (t))
dump_global_iord (t);
else if (! DECL_LANG_SPECIFIC (t))
- pp_identifier (cxx_pp, "<internal>");
+ pp_identifier (cxx_pp, "<built-in>");
else
dump_function_decl (t, flags);
break;
@@ -2145,9 +2145,8 @@ cp_print_error_function (diagnostic_context *context,
if (diagnostic_last_function_changed (context))
{
const char *old_prefix = context->printer->prefix;
- char *new_prefix = diagnostic->location.file
- ? file_name_as_prefix (diagnostic->location.file)
- : NULL;
+ const char *file = LOCATION_FILE (diagnostic->location);
+ char *new_prefix = file ? file_name_as_prefix (file) : NULL;
pp_base_set_prefix (context->printer, new_prefix);
@@ -2208,11 +2207,12 @@ print_instantiation_full_context (diagnostic_context *context)
/* Avoid redundancy with the the "In function" line. */;
else
pp_verbatim (context->printer,
- "%s: In instantiation of `%s':\n", location.file,
+ "%s: In instantiation of `%s':\n",
+ LOCATION_FILE (location),
decl_as_string (TINST_DECL (p),
TFF_DECL_SPECIFIERS | TFF_RETURN_TYPE));
- location = *EXPR_LOCUS (p);
+ location = EXPR_LOCATION (p);
p = TREE_CHAIN (p);
}
}
@@ -2225,16 +2225,20 @@ static void
print_instantiation_partial_context (diagnostic_context *context,
tree t, location_t loc)
{
- for (; t; t = TREE_CHAIN (t))
+ expanded_location xloc;
+ for (; ; t = TREE_CHAIN (t))
{
+ xloc = expand_location (loc);
+ if (t == NULL_TREE)
+ break;
pp_verbatim (context->printer, "%s:%d: instantiated from `%s'\n",
- loc.file, loc.line,
+ xloc.file, xloc.line,
decl_as_string (TINST_DECL (t),
TFF_DECL_SPECIFIERS | TFF_RETURN_TYPE));
- loc = *EXPR_LOCUS (t);
+ loc = EXPR_LOCATION (t);
}
pp_verbatim (context->printer, "%s:%d: instantiated from here\n",
- loc.file, loc.line);
+ xloc.file, xloc.line);
}
/* Called from cp_thing to print the template context for an error. */