diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2018-07-17 08:10:04 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2018-07-17 08:10:04 +0000 |
commit | 69720717c143a9dc77d4c52dd5e2f19858425fa8 (patch) | |
tree | 58f1e9f5f651c6376b9924d9b982df13c26b31c8 /gcc/ada/gcc-interface/ada-tree.h | |
parent | 123483ca18f7d6d0c5b28230e826a44a7cf4f111 (diff) | |
download | gcc-69720717c143a9dc77d4c52dd5e2f19858425fa8.zip gcc-69720717c143a9dc77d4c52dd5e2f19858425fa8.tar.gz gcc-69720717c143a9dc77d4c52dd5e2f19858425fa8.tar.bz2 |
[Ada] Type mismatch warning for imported C++ class
2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* gcc-interface/ada-tree.h (TYPE_RETURN_BY_DIRECT_REF_P): Define for
METHOD_TYPE too.
(TYPE_RETURN_UNCONSTRAINED_P): Likewise.
(TYPE_CI_CO_LIST): Likewise.
* gcc-interface/gigi.h (is_cplusplus_method): Delete.
(fntype_same_flags_p): Adjust comment.
* gcc-interface/decl.c (Has_Thiscall_Convention): Delete.
(gnat_to_gnu_entity) <E_Subprogram_Type>: Do not set the "thiscall"
attribute directly.
(is_cplusplus_method): Make static and adjust head comment.
(gnat_to_gnu_param): Return a pointer for the "this" parameter of
C++ constructors.
(gnat_to_gnu_subprog_type): Turn imported C++ constructors into their
callable form. Generate a METHOD_TYPE node for imported C++ methods.
Set param_list at the very end of the processing.
(substitute_in_type) <METHOD_TYPE>: New case.
* gcc-interface/misc.c (gnat_print_type) <METHOD_TYPE>: Likewise.
(gnat_type_hash_eq): Accept METHOD_TYPE.
* gcc-interface/trans.c (Identifier_to_gnu): Deal with METHOD_TYPE.
(Attribute_to_gnu): Likewise.
(Call_to_gnu): Likewise.
(process_freeze_entity): Likewise.
* gcc-interface/utils.c (create_subprog_decl): Adjust head comment.
(fntype_same_flags_p): Likewise.
From-SVN: r262792
Diffstat (limited to 'gcc/ada/gcc-interface/ada-tree.h')
-rw-r--r-- | gcc/ada/gcc-interface/ada-tree.h | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/gcc/ada/gcc-interface/ada-tree.h b/gcc/ada/gcc-interface/ada-tree.h index 90033d1..77e6bac 100644 --- a/gcc/ada/gcc-interface/ada-tree.h +++ b/gcc/ada/gcc-interface/ada-tree.h @@ -83,11 +83,11 @@ do { \ ((TREE_CODE (NODE) == INTEGER_TYPE || TREE_CODE (NODE) == ARRAY_TYPE) \ && TYPE_PACKED_ARRAY_TYPE_P (NODE)) -/* For FUNCTION_TYPEs, nonzero if the function returns by direct reference, - i.e. the callee returns a pointer to a memory location it has allocated - and the caller only needs to dereference the pointer. */ +/* For FUNCTION_TYPE and METHOD_TYPE, nonzero if the function returns by + direct reference, i.e. the callee returns a pointer to a memory location + it has allocated and the caller only needs to dereference the pointer. */ #define TYPE_RETURN_BY_DIRECT_REF_P(NODE) \ - TYPE_LANG_FLAG_0 (FUNCTION_TYPE_CHECK (NODE)) + TYPE_LANG_FLAG_0 (FUNC_OR_METHOD_CHECK (NODE)) /* For INTEGER_TYPE, nonzero if this is a modular type with a modulus that is not equal to two to the power of its mode's size. */ @@ -97,10 +97,10 @@ do { \ an Ada array other than the first. */ #define TYPE_MULTI_ARRAY_P(NODE) TYPE_LANG_FLAG_1 (ARRAY_TYPE_CHECK (NODE)) -/* For FUNCTION_TYPE, nonzero if this denotes a function returning an - unconstrained array or record. */ +/* For FUNCTION_TYPE and METHOD_TYPE, nonzero if function returns an + unconstrained array or record type. */ #define TYPE_RETURN_UNCONSTRAINED_P(NODE) \ - TYPE_LANG_FLAG_1 (FUNCTION_TYPE_CHECK (NODE)) + TYPE_LANG_FLAG_1 (FUNC_OR_METHOD_CHECK (NODE)) /* For RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE, nonzero if this denotes a justified modular type (will only be true for RECORD_TYPE). */ @@ -228,12 +228,11 @@ do { \ #define TYPE_GCC_MAX_VALUE(NODE) \ (TYPE_MAX_VALUE_RAW (NUMERICAL_TYPE_CHECK (NODE))) -/* For a FUNCTION_TYPE, if the subprogram has parameters passed by copy in/ - copy out, this is the list of nodes used to specify the return values of - the out (or in out) parameters that are passed by copy in/copy out. For - a full description of the copy in/copy out parameter passing mechanism - refer to the routine gnat_to_gnu_entity. */ -#define TYPE_CI_CO_LIST(NODE) TYPE_LANG_SLOT_1 (FUNCTION_TYPE_CHECK (NODE)) +/* For a FUNCTION_TYPE and METHOD_TYPE, if the function has parameters passed + by copy in/copy out, this is the list of nodes used to specify the return + values of these parameters. For a full description of the copy in/copy out + parameter passing mechanism refer to the routine gnat_to_gnu_entity. */ +#define TYPE_CI_CO_LIST(NODE) TYPE_LANG_SLOT_1 (FUNC_OR_METHOD_CHECK (NODE)) /* For an ARRAY_TYPE with variable size, this is the padding type built for the array type when it is itself the component type of another array. */ |