utils.c (gnat_type_for_size): Set TYPE_ARTIFICIAL on created types.

2017-04-27  Pierre-Marie de Rodat  <derodat@adacore.com>

	* gcc-interface/utils.c (gnat_type_for_size): Set
	TYPE_ARTIFICIAL on created types.

From-SVN: r247303
This commit is contained in:
Pierre-Marie de Rodat 2017-04-27 09:49:49 +00:00 committed by Arnaud Charlet
parent 6cbfce7e87
commit ed8cbbaf7d
2 changed files with 19 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2017-04-27 Pierre-Marie de Rodat <derodat@adacore.com>
* gcc-interface/utils.c (gnat_type_for_size): Set
TYPE_ARTIFICIAL on created types.
2017-04-27 Claire Dross <dross@adacore.com>
* a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to

View File

@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
* Copyright (C) 1992-2016, Free Software Foundation, Inc. *
* Copyright (C) 1992-2017, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@ -359,7 +359,7 @@ tree
make_dummy_type (Entity_Id gnat_type)
{
Entity_Id gnat_equiv = Gigi_Equivalent_Type (Underlying_Type (gnat_type));
tree gnu_type;
tree gnu_type, debug_type;
/* If there was no equivalent type (can only happen when just annotating
types) or underlying type, go back to the original type. */
@ -384,6 +384,17 @@ make_dummy_type (Entity_Id gnat_type)
SET_DUMMY_NODE (gnat_equiv, gnu_type);
/* Create a debug type so that debug info consumers only see an unspecified
type. */
if (Needs_Debug_Info (gnat_type))
{
debug_type = make_node (LANG_TYPE);
SET_TYPE_DEBUG_TYPE (gnu_type, debug_type);
TYPE_NAME (debug_type) = TYPE_NAME (gnu_type);
TYPE_ARTIFICIAL (debug_type) = TYPE_ARTIFICIAL (gnu_type);
}
return gnu_type;
}
@ -3384,6 +3395,7 @@ gnat_type_for_size (unsigned precision, int unsignedp)
t = make_unsigned_type (precision);
else
t = make_signed_type (precision);
TYPE_ARTIFICIAL (t) = 1;
if (precision <= 2 * MAX_BITS_PER_WORD)
signed_and_unsigned_types[precision][unsignedp] = t;