summaryrefslogtreecommitdiffstats
path: root/gcc/cp/error.c
diff options
context:
space:
mode:
authorbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-25 07:36:35 +0000
committerbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-25 07:36:35 +0000
commitc5dd8e0655c49a78d393feaed430419e1d5fe40e (patch)
tree04d6f366703986c060bd377e1803b71669165e0b /gcc/cp/error.c
parente920484a9b109126c9da7c4054dc6c88a4e252c1 (diff)
downloadppe42-gcc-c5dd8e0655c49a78d393feaed430419e1d5fe40e.tar.gz
ppe42-gcc-c5dd8e0655c49a78d393feaed430419e1d5fe40e.zip
2007-08-25 Paolo Bonzini <bonzini@gnu.org>
* decl.c (cp_tree_node_structure): Kill TINST_LEVEL case. * cp-objcp-common.c (cp_tree_size): Ditto. * tree.c (cp_walk_subtrees): Ditto * cp-tree.def (TINST_LEVEL): Go away. * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level, move together with other non-tree structs. (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL. (union lang_tree_node): Eliminate tinst_level field. (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate. (current_instantiation, outermost_tinst_level): Return a "struct tinst_level *". * error.c (print_instantiation_partial_context): Change second parameter to a "struct tinst_level *". Replace accessor macros with field access. (print_instantiation_full_context): Likewise. * lex.c (in_main_input_context): Likewise. * pt.c (struct pending_templates): New. (pending_templates, last_pending_template): Use it as a type. (current_tinst_level): Change typo to "struct tinst_level *" (reopen_tinst_level): Accept "struct tinst_level *", return decl. (add_pending_template): Construct a "struct pending_template". Replace TINST_LEVEL accessor macros with field access. (push_tinst_level): Likewise, using GGC_NEW instead of make_node. (pop_tinst_level): Likewise. (instantiate_pending_templates): Likewise. Factor common code used when an instantiation has been done. (outermost_tinst_level): Replace tree_last with loop. (current_instantiation): Return a "struct tinst_level *". git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127796 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r--gcc/cp/error.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 16ba95c5c88..2a1fa52d3e5 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -82,7 +82,8 @@ 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, location_t);
+ struct tinst_level *,
+ 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 *);
@@ -2388,30 +2389,30 @@ function_category (tree fn)
static void
print_instantiation_full_context (diagnostic_context *context)
{
- tree p = current_instantiation ();
+ struct tinst_level *p = current_instantiation ();
location_t location = input_location;
if (p)
{
- if (current_function_decl != TINST_DECL (p)
+ if (current_function_decl != p->decl
&& current_function_decl != NULL_TREE)
/* We can get here during the processing of some synthesized
- method. Then, TINST_DECL (p) will be the function that's causing
+ method. Then, P->DECL will be the function that's causing
the synthesis. */
;
else
{
- if (current_function_decl == TINST_DECL (p))
+ if (current_function_decl == p->decl)
/* Avoid redundancy with the "In function" line. */;
else
pp_verbatim (context->printer,
"%s: In instantiation of %qs:\n",
LOCATION_FILE (location),
- decl_as_string (TINST_DECL (p),
+ decl_as_string (p->decl,
TFF_DECL_SPECIFIERS | TFF_RETURN_TYPE));
- location = TINST_LOCATION (p);
- p = TREE_CHAIN (p);
+ location = p->locus;
+ p = p->next;
}
}
@@ -2421,19 +2422,19 @@ print_instantiation_full_context (diagnostic_context *context)
/* Same as above but less verbose. */
static void
print_instantiation_partial_context (diagnostic_context *context,
- tree t, location_t loc)
+ struct tinst_level *t, location_t loc)
{
expanded_location xloc;
- for (; ; t = TREE_CHAIN (t))
+ for (; ; t = t->next)
{
xloc = expand_location (loc);
- if (t == NULL_TREE)
+ if (t == NULL)
break;
pp_verbatim (context->printer, "%s:%d: instantiated from %qs\n",
xloc.file, xloc.line,
- decl_as_string (TINST_DECL (t),
+ decl_as_string (t->decl,
TFF_DECL_SPECIFIERS | TFF_RETURN_TYPE));
- loc = TINST_LOCATION (t);
+ loc = t->locus;
}
pp_verbatim (context->printer, "%s:%d: instantiated from here",
xloc.file, xloc.line);
OpenPOWER on IntegriCloud