aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2017-09-06 17:22:40 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2017-09-06 17:22:40 +0000
commit3f8cf83477cc336b1fec73ef16293644cd5ec453 (patch)
tree72f4aaf00ca8aaec07f0899d9e9cd1af8f5eac5c /gcc/ada/gcc-interface/decl.c
parent260da991920f7cd05a38216e19894882a359362b (diff)
downloadgcc-3f8cf83477cc336b1fec73ef16293644cd5ec453.zip
gcc-3f8cf83477cc336b1fec73ef16293644cd5ec453.tar.gz
gcc-3f8cf83477cc336b1fec73ef16293644cd5ec453.tar.bz2
decl.c (warn_on_field_placement): Issue the warning only if the record type itself comes from source.
* gcc-interface/decl.c (warn_on_field_placement): Issue the warning only if the record type itself comes from source. From-SVN: r251812
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r--gcc/ada/gcc-interface/decl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index c9a701d..8514d9a 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -7263,6 +7263,9 @@ warn_on_field_placement (tree gnu_field, Node_Id gnat_component_list,
Entity_Id gnat_record_type, bool in_variant,
bool do_reorder)
{
+ if (!Comes_From_Source (gnat_record_type))
+ return;
+
const char *msg1
= in_variant
? "?variant layout may cause performance issues"
@@ -7277,6 +7280,7 @@ warn_on_field_placement (tree gnu_field, Node_Id gnat_component_list,
= do_reorder
? "?comes too early and was moved down"
: "?comes too early and ought to be moved down";
+
Entity_Id gnat_field
= gnu_field_to_gnat (gnu_field, gnat_component_list, gnat_record_type);