aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2017-08-07 15:09:07 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2017-08-07 15:09:07 +0000
commitdb44013866d4a8c09d781d9a6c6ca738dd889e89 (patch)
treef99703c1e4bafd2f545e7b0a29aced53f018a146 /gcc
parent30079dde47ad224613340f220df061cb4a5829b7 (diff)
downloadgcc-db44013866d4a8c09d781d9a6c6ca738dd889e89.zip
gcc-db44013866d4a8c09d781d9a6c6ca738dd889e89.tar.gz
gcc-db44013866d4a8c09d781d9a6c6ca738dd889e89.tar.bz2
c-ada-spec.c (has_nontrivial_methods): Test for FUNCTION_DECL.
* c-ada-spec.c (has_nontrivial_methods): Test for FUNCTION_DECL. (print_ada_methods): Likewise. (print_ada_declaration): Likewise. From-SVN: r250920
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-family/ChangeLog6
-rw-r--r--gcc/c-family/c-ada-spec.c9
2 files changed, 10 insertions, 5 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index ba007b9..1243eef 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-07 Eric Botcazou <ebotcazou@adacore.com>
+
+ * c-ada-spec.c (has_nontrivial_methods): Test for FUNCTION_DECL.
+ (print_ada_methods): Likewise.
+ (print_ada_declaration): Likewise.
+
2017-08-07 Martin Liska <mliska@suse.cz>
* array-notation-common.c: Add new includes.
diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c
index dac437d..6c050fb 100644
--- a/gcc/c-family/c-ada-spec.c
+++ b/gcc/c-family/c-ada-spec.c
@@ -1099,7 +1099,7 @@ has_nontrivial_methods (tree type)
/* If there are user-defined methods, they are deemed non-trivial. */
for (tree fld = TYPE_FIELDS (type); fld; fld = DECL_CHAIN (fld))
- if (TREE_CODE (TREE_TYPE (fld)) == METHOD_TYPE && !DECL_ARTIFICIAL (fld))
+ if (TREE_CODE (fld) == FUNCTION_DECL && !DECL_ARTIFICIAL (fld))
return true;
return false;
@@ -2442,7 +2442,7 @@ print_ada_methods (pretty_printer *buffer, tree node, int spc)
int res = 1;
for (tree fld = TYPE_FIELDS (node); fld; fld = DECL_CHAIN (fld))
- if (TREE_CODE (TREE_TYPE (fld)) == METHOD_TYPE)
+ if (TREE_CODE (fld) == FUNCTION_DECL)
{
if (res)
{
@@ -2955,8 +2955,7 @@ print_ada_declaration (pretty_printer *buffer, tree t, tree type, int spc)
if (is_constructor && RECORD_OR_UNION_TYPE_P (type))
for (tree fld = TYPE_FIELDS (type); fld; fld = DECL_CHAIN (fld))
- if (TREE_CODE (TREE_TYPE (fld)) == METHOD_TYPE
- && cpp_check (fld, IS_ABSTRACT))
+ if (TREE_CODE (fld) == FUNCTION_DECL && cpp_check (fld, IS_ABSTRACT))
{
is_abstract_class = true;
break;
@@ -3036,7 +3035,7 @@ print_ada_declaration (pretty_printer *buffer, tree t, tree type, int spc)
is_interface = 0;
has_fields = true;
}
- else if (TREE_CODE (TREE_TYPE (fld)) == METHOD_TYPE
+ else if (TREE_CODE (fld) == FUNCTION_DECL
&& !DECL_ARTIFICIAL (fld))
{
if (cpp_check (fld, IS_ABSTRACT))