diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-02-25 15:11:39 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-02-25 15:11:39 +0000 |
commit | 3d33b949aac9daae578ce67d9f4691a8a5a4a08d (patch) | |
tree | fde1444e6ac3289e10eb4a61cb47f302880ea78c /gcc/ada/sem_prag.adb | |
parent | 334d1dbea30a398c5095983f7b6dfdd851bfee12 (diff) | |
download | gcc-3d33b949aac9daae578ce67d9f4691a8a5a4a08d.tar.gz |
2014-02-25 Robert Dewar <dewar@adacore.com>
* exp_ch7.adb, sem_util.adb, sem_util.ads, exp_ch6.adb: Minor
reformatting.
2014-02-25 Ed Schonberg <schonberg@adacore.com>
* freeze.adb (Freeze_Entity): If the return type of a function
is a limited view, and the non-limited view has not been seen yet,
defer freezing to some later point.
2014-02-25 Robert Dewar <dewar@adacore.com>
* sem_ch3.adb: Minor reformatting.
2014-02-25 Robert Dewar <dewar@adacore.com>
* s-excdeb.ads, s-except.ads, s-exctab.adb, s-exctab.ads, s-finmas.ads,
s-htable.adb, s-htable.ads, s-imenne.adb, s-imenne.ads, s-imgenu.adb,
s-imgenu.ads, s-mastop.adb, s-mastop.ads, s-memory-vms_64.adb,
s-memory-vms_64.ads, s-memory.adb, s-memory.ads, s-os_lib.adb,
s-os_lib.ads, s-parame.adb, s-parame.ads, s-purexc.ads, s-restri.adb,
s-restri.ads, s-rident.ads, s-secsta.adb, s-secsta.ads, s-soflin.adb,
s-soflin.ads, s-sopco3.adb, s-sopco3.ads, s-sopco4.adb, s-sopco4.ads,
s-sopco5.adb, s-sopco5.ads, s-spsufi.ads, s-stache.adb, s-stache.ads,
s-stalib.adb, s-stalib.ads, s-stoele.adb, s-stoele.ads, s-strcom.adb,
s-strcom.ads, s-strhas.adb, s-string.adb, s-string.ads, s-strops.adb,
s-strops.ads, s-ststop.adb, s-ststop.ads, s-traceb.adb, s-traceb.ads,
s-traent.adb, s-traent.ads, s-unstyp.ads, s-utf_32.adb, s-utf_32.ads,
s-wchcnv.adb, s-wchcnv.ads, s-wchcon.adb, s-wchcon.ads, s-wchjis.adb,
s-wchjis.ads, sem_ch11.adb, sem_ch4.adb, sem_ch5.adb, sem_prag.adb,
snames.ads-tmpl: Change Compiler_Unit everywhere to
Compiler_Unit_Warning.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208135 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_prag.adb')
-rw-r--r-- | gcc/ada/sem_prag.adb | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index a5eaf1304bd..a1d381c8b90 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -2827,6 +2827,10 @@ package body Sem_Prag is -- Analyze_Pragma -- -------------------- + -------------------- + -- Analyze_Pragma -- + -------------------- + procedure Analyze_Pragma (N : Node_Id) is Loc : constant Source_Ptr := Sloc (N); Prag_Id : Pragma_Id; @@ -12240,11 +12244,39 @@ package body Sem_Prag is GNAT_Pragma; Process_Compile_Time_Warning_Or_Error; - ------------------- - -- Compiler_Unit -- - ------------------- + --------------------------- + -- Compiler_Unit_Warning -- + --------------------------- + + -- pragma Compiler_Unit_Warning; + + -- Historical note + + -- Originally, we had only pragma Compiler_Unit, and it resulted in + -- errors not warnings. This means that we had introduced a big extra + -- inertia to compiler changes, since even if we implemented a new + -- feature, and even if all versions to be used for bootstrapping + -- implemented this new feature, we could not use it, since old + -- compilers would give errors for using this feature in units + -- having Compiler_Unit pragmas. + + -- By changing Compiler_Unit to Compiler_Unit_Warning, we solve the + -- problem. We no longer have any units mentioning Compiler_Unit, + -- so old compilers see Compiler_Unit_Warning which is unrecognized, + -- and thus generates a warning which can be ignored. So that deals + -- with the problem of old compilers not implementing the newer form + -- of the pragma. + + -- Newer compilers recognize the new pragma, but generate warning + -- messages instead of errors, which again can be ignored in the + -- case of an old compiler which implements a wanted new feature + -- but at the time felt like warning about it for older compilers. + + -- We retain Compiler_Unit so that new compilers can be used to build + -- older run-times that use this pragma. That's an unusual case, but + -- it's easy enough to handle, so why not? - when Pragma_Compiler_Unit => + when Pragma_Compiler_Unit | Pragma_Compiler_Unit_Warning => GNAT_Pragma; Check_Arg_Count (0); Set_Is_Compiler_Unit (Get_Source_Unit (N)); @@ -25521,6 +25553,7 @@ package body Sem_Prag is Pragma_Compile_Time_Error => -1, Pragma_Compile_Time_Warning => -1, Pragma_Compiler_Unit => 0, + Pragma_Compiler_Unit_Warning => 0, Pragma_Complete_Representation => 0, Pragma_Complex_Representation => 0, Pragma_Component_Alignment => -1, |