diff options
author | Robert Dewar <dewar@adacore.com> | 2009-07-13 10:22:57 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-07-13 12:22:57 +0200 |
commit | 2c011ce1cd6eedc5d707c5f963b8f7d0b160db5b (patch) | |
tree | b1fa70fd288fc7c51d82415fe99f6bddb38e414e /gcc/ada/lib.adb | |
parent | db55a299065a32d1ee32144dcee723bfd0870e4b (diff) | |
download | gcc-2c011ce1cd6eedc5d707c5f963b8f7d0b160db5b.tar.gz |
lib.adb, [...]: Minor reformatting and code reorganization.
2009-07-13 Robert Dewar <dewar@adacore.com>
* lib.adb, prj-nmsc.adb, prj-proc.adb, prj-proc.ads, prj.adb,
prj.ads: Minor reformatting and code reorganization.
* par-ch3.adb (Check_Restricted_Expression): New procedure
From-SVN: r149566
Diffstat (limited to 'gcc/ada/lib.adb')
-rw-r--r-- | gcc/ada/lib.adb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/ada/lib.adb b/gcc/ada/lib.adb index 802506b5672..63dd62025fe 100644 --- a/gcc/ada/lib.adb +++ b/gcc/ada/lib.adb @@ -605,13 +605,15 @@ package body Lib is -- If not in the table, must be a spec created for a main unit that is a -- child subprogram body which we have not inserted into the table yet. - if N /= Library_Unit (Cunit (Main_Unit)) then - -- We do not use a pragma Assert here, since this would not be - -- enabled in case assertions are not active. + if N = Library_Unit (Cunit (Main_Unit)) then + return Main_Unit; + + -- If it is anything else, something is seriously wrong, and we really + -- don't want to proceed, even if assertions are off, so we explicitly + -- raise an exception in this case to terminate compilation. - raise Program_Error; else - return Main_Unit; + raise Program_Error; end if; end Get_Cunit_Unit_Number; |