diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2017-09-06 17:22:40 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2017-09-06 17:22:40 +0000 |
commit | 3f8cf83477cc336b1fec73ef16293644cd5ec453 (patch) | |
tree | 72f4aaf00ca8aaec07f0899d9e9cd1af8f5eac5c | |
parent | 260da991920f7cd05a38216e19894882a359362b (diff) | |
download | gcc-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
-rw-r--r-- | gcc/ada/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 168458f..5f7b1bc 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2017-09-06 Eric Botcazou <ebotcazou@adacore.com> + + * gcc-interface/decl.c (warn_on_field_placement): Issue the warning + only if the record type itself comes from source. + 2017-09-06 Gary Dismukes <dismukes@adacore.com> * sem_ch5.adb: Minor reformatting and a typo fix @@ -62,8 +67,7 @@ every component whose RM_Size is statically known. Add missing guard to check that bit packing is really required before issuing the error about packing. Swap condition for clarity's sake. - * sem_prag.adb (Usage_Error): fix reference to - SPARK RM in comment + * sem_prag.adb (Usage_Error): Fix reference to SPARK RM in comment. 2017-09-06 Fedor Rybin <frybin@adacore.com> 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); |