From ed8cbbaf7d254e592bd9e57931cf2d57b6f62e9c Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Thu, 27 Apr 2017 09:49:49 +0000 Subject: [PATCH] utils.c (gnat_type_for_size): Set TYPE_ARTIFICIAL on created types. 2017-04-27 Pierre-Marie de Rodat * gcc-interface/utils.c (gnat_type_for_size): Set TYPE_ARTIFICIAL on created types. From-SVN: r247303 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/gcc-interface/utils.c | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 8bffbec10ff..98c2fa9a4db 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2017-04-27 Pierre-Marie de Rodat + + * gcc-interface/utils.c (gnat_type_for_size): Set + TYPE_ARTIFICIAL on created types. + 2017-04-27 Claire Dross * a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 0a6d6af5b52..4549a1b64fe 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -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; -- 2.30.2