summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch2.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-02 15:15:07 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-02 15:15:07 +0000
commit3fb2a10cf101bedbc2b3a89f1927ce766fe2bbad (patch)
tree101c010bb1f1495a3e5010af30b9b9a86d819f3f /gcc/ada/sem_ch2.adb
parent1a8692d32d0edafcfbf604a452a306f071689ebe (diff)
downloadgcc-3fb2a10cf101bedbc2b3a89f1927ce766fe2bbad.tar.gz
2011-08-02 Yannick Moy <moy@adacore.com>
* einfo.adb, einfo.ads (Body_Is_In_ALFA, Set_Body_Is_In_ALFA): get/set for new flag denoting which subprogram bodies are in ALFA * restrict.adb, sem_ch7.adb: Update comment * sem_ch11.adb, sem_ch2.adb, sem_ch3.adb, sem_ch4.adb, sem_ch5.adb, sem_ch9.adb, sem_res.adb: Add calls to Current_Subprogram_Body_Is_Not_In_ALFA on unsupported constructs. * sem_ch6.adb (Analyze_Function_Return): add calls to Current_Subprogram_Body_Is_Not_In_ALFA on return statement in the middle of the body, and extended return. (Check_Missing_Return): add calls to Set_Body_Is_In_ALFA with argument False when missing return. (Analyze_Subprogram_Body_Helper): initialize the flag Body_Is_In_ALFA to True for subprograms whose spec is in ALFA. Remove later on the flag on the entity used for a subprogram body when there exists a separate declaration. * sem_util.adb, sem_util.ads (Current_Subprogram_Body_Is_Not_In_ALFA): if Current_Subprogram is not Empty, set its flag Body_Is_In_ALFA to False, otherwise do nothing. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177177 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch2.adb')
-rw-r--r--gcc/ada/sem_ch2.adb11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch2.adb b/gcc/ada/sem_ch2.adb
index 3a3bbf9d245..2a021d2d787 100644
--- a/gcc/ada/sem_ch2.adb
+++ b/gcc/ada/sem_ch2.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -24,12 +24,14 @@
------------------------------------------------------------------------------
with Atree; use Atree;
+with Einfo; use Einfo;
with Errout; use Errout;
with Namet; use Namet;
with Opt; use Opt;
with Restrict; use Restrict;
with Rident; use Rident;
with Sem_Ch8; use Sem_Ch8;
+with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
with Stand; use Stand;
with Uintp; use Uintp;
@@ -74,6 +76,13 @@ package body Sem_Ch2 is
return;
else
Find_Direct_Name (N);
+
+ if Present (Entity (N))
+ and then Is_Object (Entity (N))
+ and then not Is_In_ALFA (Entity (N))
+ then
+ Current_Subprogram_Body_Is_Not_In_ALFA;
+ end if;
end if;
end Analyze_Identifier;