aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/lib-writ.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-12-05 11:44:58 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2011-12-05 11:44:58 +0100
commit76264f602ae32ac6fea5e80ac0098d07b40fe4ab (patch)
treec9a9215ce2eb42e4e990fdaa7c8f4d3a1ad9ff39 /gcc/ada/lib-writ.adb
parent7f3d8f56e747b1a814c633a9ab160adf02b5d498 (diff)
downloadgcc-76264f602ae32ac6fea5e80ac0098d07b40fe4ab.zip
gcc-76264f602ae32ac6fea5e80ac0098d07b40fe4ab.tar.gz
gcc-76264f602ae32ac6fea5e80ac0098d07b40fe4ab.tar.bz2
[multiple changes]
2011-12-05 Bob Duff <duff@adacore.com> * sem_ch4.adb: Minor comment fix. 2011-12-05 Robert Dewar <dewar@adacore.com> * gnat_ugn.texi: Add documentation for -gnatw.e. 2011-12-05 Bob Duff <duff@adacore.com> * treepr.adb (pn): Print something useful for Elmt_Ids. Add Write_Eol to 'when others' case, so the output will be seen immediately in gdb. 2011-12-05 Ed Schonberg <schonberg@adacore.com> * lib-writ.adb (Output_Main_Program_Line): A generic subprogram is never a main program. 2011-12-05 Thomas Quinot <quinot@adacore.com> * par_sco.adb: Various minor adjustments to dominance markers generation. 2011-12-05 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Analyze_Expression_Function): If the function is a completion, generate a body reference for its defining entity, before rewriting the node as a body. * sem_util.adb (Defining_Entity): Add entry for expression function. From-SVN: r182006
Diffstat (limited to 'gcc/ada/lib-writ.adb')
-rw-r--r--gcc/ada/lib-writ.adb12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb
index 25c2559..2d67ea0 100644
--- a/gcc/ada/lib-writ.adb
+++ b/gcc/ada/lib-writ.adb
@@ -987,7 +987,17 @@ package body Lib.Writ is
S := Specification (U);
- if No (Parameter_Specifications (S)) then
+ -- A generic subprogram is never a main program
+
+ if Nkind (U) = N_Subprogram_Body
+ and then Present (Corresponding_Spec (U))
+ and then
+ Ekind_In (Corresponding_Spec (U),
+ E_Generic_Procedure, E_Generic_Function)
+ then
+ null;
+
+ elsif No (Parameter_Specifications (S)) then
if Nkind (S) = N_Procedure_Specification then
Write_Info_Initiate ('M');
Write_Info_Str (" P");