aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2003-06-28 19:02:32 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2003-06-28 19:02:32 +0000
commit357734719bc1f42da202c8d0e28a80f4a87e682b (patch)
tree2ce64a436903cc81f11734c7ac9f759418366d99
parent9a472a42247d099c512b6d992890f88643612c8c (diff)
downloadgcc-357734719bc1f42da202c8d0e28a80f4a87e682b.zip
gcc-357734719bc1f42da202c8d0e28a80f4a87e682b.tar.gz
gcc-357734719bc1f42da202c8d0e28a80f4a87e682b.tar.bz2
error.c (print_instantiation_partial_context): Take a location_t.
* error.c (print_instantiation_partial_context): Take a location_t. (print_instantiation_full_context): Adjust. (print_instantiation_context): Adjust. From-SVN: r68644
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/error.c22
2 files changed, 17 insertions, 10 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 16a909e..ae461ed 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,10 @@
2003-06-28 Nathan Sidwell <nathan@codesourcery.com>
+ * error.c (print_instantiation_partial_context): Take a
+ location_t.
+ (print_instantiation_full_context): Adjust.
+ (print_instantiation_context): Adjust.
+
* cp-tree.h (cp_line_of, cp_file_of): Remove.
* error.c (cp_line_of, cp_file_of): Merge into ...
(location_of): ... here. Make static, return a location_t.
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index a5420a7..9962485 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -104,7 +104,7 @@ static const char *function_category (tree);
static void maybe_print_instantiation_context (diagnostic_context *);
static void print_instantiation_full_context (diagnostic_context *);
static void print_instantiation_partial_context (diagnostic_context *,
- tree, const char *, int);
+ tree, location_t);
static void cp_diagnostic_starter (diagnostic_context *, diagnostic_info *);
static void cp_diagnostic_finalizer (diagnostic_context *, diagnostic_info *);
static void cp_print_error_function (diagnostic_context *, diagnostic_info *);
@@ -2403,24 +2403,26 @@ print_instantiation_full_context (diagnostic_context *context)
}
}
- print_instantiation_partial_context (context, p,
- location.file, location.line);
+ print_instantiation_partial_context (context, p, location);
}
/* Same as above but less verbose. */
static void
print_instantiation_partial_context (diagnostic_context *context,
- tree t, const char *file, int line)
+ tree t, location_t loc)
{
for (; t; t = TREE_CHAIN (t))
{
output_verbatim
- (&context->buffer, "%s:%d: instantiated from `%s'\n", file, line,
- decl_as_string (TINST_DECL (t), TFF_DECL_SPECIFIERS | TFF_RETURN_TYPE));
- line = TINST_LINE (t);
- file = TINST_FILE (t);
+ (&context->buffer, "%s:%d: instantiated from `%s'\n",
+ loc.file, loc.line,
+ decl_as_string (TINST_DECL (t),
+ TFF_DECL_SPECIFIERS | TFF_RETURN_TYPE));
+ loc.line = TINST_LINE (t);
+ loc.file = TINST_FILE (t);
}
- output_verbatim (&context->buffer, "%s:%d: instantiated from here\n", file, line);
+ output_verbatim (&context->buffer, "%s:%d: instantiated from here\n",
+ loc.file, loc.line);
}
/* Called from cp_thing to print the template context for an error. */
@@ -2439,7 +2441,7 @@ void
print_instantiation_context (void)
{
print_instantiation_partial_context
- (global_dc, current_instantiation (), input_filename, input_line);
+ (global_dc, current_instantiation (), input_location);
diagnostic_flush_buffer (global_dc);
}