summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_elim.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2004-04-26 14:29:41 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2004-04-26 14:29:41 +0200
commit35b7fa6a40c32d4f36cddcd69d9014b53a02ae0d (patch)
tree5420010f2d8952a835be61c074615295b46149c6 /gcc/ada/sem_elim.adb
parente11283f1b4f17d4d045a10a315cb47453ffcc927 (diff)
downloadgcc-35b7fa6a40c32d4f36cddcd69d9014b53a02ae0d.tar.gz
[multiple changes]
2004-04-26 Thomas Quinot <quinot@act-europe.fr> * sem_dist.adb, exp_dist.adb: When constructing a RAS value for a local subprogram for which no pragma All_Calls_Remote applies, store the address of the real subprogram in the underlying record type, so local dereferences do not go through the PCS. 2004-04-26 Robert Dewar <dewar@gnat.com> * i-c.ads: Add some type qualifications to avoid ambiguities when compiling with s-auxdec.ads and a non-private address type. 2004-04-26 Arnaud Charlet <charlet@act-europe.fr> * Makefile.rtl: Fix error in previous check-in: Add s-addope.o to non tasking object list (rather than tasking object list). 2004-04-26 Javier Miranda <miranda@gnat.com> * sem_aggr.adb: Fix typo in comments (Resolve_Aggr_Expr): Propagate the type to the nested aggregate. Required to check the null-exclusion attribute. * sem_attr.adb (Resolve_Attribute): Check the accessibility level in case of anonymous access types in record and array components. For a component definition the level is the same of the enclosing composite type. * sem_ch3.adb (Analyze_Component_Declaration): In case of components that are anonymous access types the level of accessibility depends on the enclosing type declaration. In order to have this information, set the scope of the anonymous access type to the enclosing record type declaration. (Array_Type_Declaration): In case of components that are anonymous access types the level of accessibility depends on the enclosing type declaration. In order to have this information, set the scope of the anonymous access type to the enclosing array type declaration. * sem_ch3.adb (Array_Type_Declaration): Set the scope of the anonymous access type. * sem_ch8.adb (Analyze_Object_Renaming): Add check to verify that renaming of anonymous access-to-constant types allowed if and only if the renamed object is access-to-constant. * sem_util.adb (Type_Access_Level): In case of anonymous access types that are component_definition or discriminants of a nonlimited type, the level is the same as that of the enclosing component type. 2004-04-26 Sergey Rybin <rybin@act-europe.fr> * sem_elim.adb: Some minor code reorganization from code reading. Fix misprint in the function name (File_Name_Match). From-SVN: r81186
Diffstat (limited to 'gcc/ada/sem_elim.adb')
-rw-r--r--gcc/ada/sem_elim.adb53
1 files changed, 36 insertions, 17 deletions
diff --git a/gcc/ada/sem_elim.adb b/gcc/ada/sem_elim.adb
index 6c0561071b3..9f138ebf7ce 100644
--- a/gcc/ada/sem_elim.adb
+++ b/gcc/ada/sem_elim.adb
@@ -376,7 +376,7 @@ package body Sem_Elim is
P : Source_Ptr;
Sindex : Source_File_Index;
- function File_Mame_Match return Boolean;
+ function File_Name_Match return Boolean;
-- This function is supposed to be called when Idx points
-- to the beginning of the new file name, and Name_Buffer
-- is set to contain the name of the proper source file
@@ -436,45 +436,64 @@ package body Sem_Elim is
end if;
end Different_Trace_Lengths;
- function File_Mame_Match return Boolean is
- Tmp_Idx : Positive := 1;
- End_Idx : Positive := 1;
- -- Initializations are to stop warnings
+ ---------------------
+ -- File_Name_Match --
+ ---------------------
- -- But are warnings possibly valid ???
- -- Why are loops below guaranteed to exit ???
+ function File_Name_Match return Boolean is
+ Tmp_Idx : Natural;
+ End_Idx : Natural;
begin
if Idx = 0 then
return False;
end if;
- for J in Idx .. Last loop
- if Sloc_Trace (J) = ':' then
- Tmp_Idx := J - 1;
+ -- Find first colon. If no colon, then return False.
+ -- If there is a colon, Tmp_Idx is set to point just
+ -- before the colon.
+
+ Tmp_Idx := Idx - 1;
+ loop
+ if Tmp_Idx >= Last then
+ return False;
+ elsif Sloc_Trace (Tmp_Idx + 1) = ':' then
exit;
+ else
+ Tmp_Idx := Tmp_Idx + 1;
end if;
end loop;
- for J in reverse Idx .. Tmp_Idx loop
- if Sloc_Trace (J) /= ' ' then
- End_Idx := J;
+ -- Find last non-space before this colon. If there
+ -- is no no space character before this colon, then
+ -- return False. Otherwise, End_Idx set to point to
+ -- this non-space character.
+
+ End_Idx := Tmp_Idx;
+ loop
+ if End_Idx < Idx then
+ return False;
+ elsif Sloc_Trace (End_Idx) /= ' ' then
exit;
+ else
+ End_Idx := End_Idx - 1;
end if;
end loop;
+ -- Now see if file name matches what is in Name_Buffer
+ -- and if so, step Idx past it and return True. If the
+ -- name does not match, return False.
+
if Sloc_Trace (Idx .. End_Idx) =
Name_Buffer (1 .. Name_Len)
then
Idx := Tmp_Idx + 2;
-
Idx := Skip_Spaces;
-
return True;
else
return False;
end if;
- end File_Mame_Match;
+ end File_Name_Match;
--------------------
-- Line_Num_Match --
@@ -548,7 +567,7 @@ package body Sem_Elim is
Idx := Skip_Spaces;
while Idx > 0 loop
- if not File_Mame_Match then
+ if not File_Name_Match then
goto Continue;
elsif not Line_Num_Match then
goto Continue;