Commit 83ed54d7 by Eric Botcazou Committed by Eric Botcazou

c-ada-spec.c (is_tagged_type): Add guard for DECL_VINDEX.

	* c-ada-spec.c (is_tagged_type): Add guard for DECL_VINDEX.
	(dump_template_types): Adjust DECL_TEMPLATE_INSTANTIATIONS and
	DECL_TEMPLATE_RESULT emulations.
	(dump_ada_template)): Add guard for TYPE_METHODS.

From-SVN: r221088
parent 7dff0c74
2015-03-01 Eric Botcazou <ebotcazou@adacore.com>
* c-ada-spec.c (is_tagged_type): Add guard for DECL_VINDEX.
(dump_template_types): Adjust DECL_TEMPLATE_INSTANTIATIONS and
DECL_TEMPLATE_RESULT emulations.
(dump_ada_template)): Add guard for TYPE_METHODS.
2015-02-27 Marek Polacek <polacek@redhat.com>
PR c/65040
......
......@@ -961,7 +961,7 @@ is_tagged_type (const_tree type)
return false;
for (tmp = TYPE_METHODS (type); tmp; tmp = TREE_CHAIN (tmp))
if (DECL_VINDEX (tmp))
if (TREE_CODE (tmp) == FUNCTION_DECL && DECL_VINDEX (tmp))
return true;
return false;
......@@ -1730,10 +1730,15 @@ dump_template_types (pretty_printer *buffer, tree types, int spc)
static int
dump_ada_template (pretty_printer *buffer, tree t, int spc)
{
/* DECL_VINDEX is DECL_TEMPLATE_INSTANTIATIONS in this context. */
tree inst = DECL_VINDEX (t);
/* DECL_RESULT_FLD is DECL_TEMPLATE_RESULT in this context. */
tree result = DECL_RESULT_FLD (t);
/* DECL_SIZE_UNIT is DECL_TEMPLATE_INSTANTIATIONS in this context. */
tree inst = DECL_SIZE_UNIT (t);
/* This emulates DECL_TEMPLATE_RESULT in this context. */
struct tree_template_decl {
struct tree_decl_common common;
tree arguments;
tree result;
};
tree result = ((struct tree_template_decl *) t)->result;
int num_inst = 0;
/* Don't look at template declarations declaring something coming from
......@@ -1750,7 +1755,7 @@ dump_ada_template (pretty_printer *buffer, tree t, int spc)
if (TREE_VEC_LENGTH (types) == 0)
break;
if (!TYPE_P (instance) || !TYPE_METHODS (instance))
if (!RECORD_OR_UNION_TYPE_P (instance) || !TYPE_METHODS (instance))
break;
num_inst++;
......
2015-03-01 Eric Botcazou <ebotcazou@adacore.com>
* g++.dg/other/dump-ada-spec-3.C: New test.
2015-03-01 Martin Liska <mliska@suse.cz>
* gcc.target/i386/stackalign/longlong-2.c: Omit ICF.
......
/* { dg-do compile } */
/* { dg-options "-fdump-ada-spec" } */
#include <iostream>
using namespace std;
class Base {
public:
int My_V;
virtual void Primitive ();
Base ();
};
void Base::Primitive () {
cout << "C++ Primitive " << this->My_V << "\n";
}
Base::Base () {
}
void Dispatch (Base * B) {
B->Primitive ();
}
/* { dg-final { cleanup-ada-spec } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment