aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/get_scos.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2012-12-05 12:15:35 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2012-12-05 12:15:35 +0100
commit06ad40d3ec3ec2333701f18f6dc6bbf0b9a023ec (patch)
treec11a325254c0fff96f54a201f14e401c959ece35 /gcc/ada/get_scos.adb
parentaf31bd57502fd7fef4891658c74cb5fdb3c160e4 (diff)
downloadgcc-06ad40d3ec3ec2333701f18f6dc6bbf0b9a023ec.zip
gcc-06ad40d3ec3ec2333701f18f6dc6bbf0b9a023ec.tar.gz
gcc-06ad40d3ec3ec2333701f18f6dc6bbf0b9a023ec.tar.bz2
[multiple changes]
2012-12-05 Thomas Quinot <quinot@adacore.com> * par_sco.adb, scos.ads, put_scos.adb, put_scos.ads, get_scos.adb: Generation of SCOs for aspects. 2012-12-05 Thomas Quinot <quinot@adacore.com> * sem_prag.adb (Check_Precondition_Postcondition): Remove redundant call to Set_SCO_Pragma_Enabled (the pragma will be rewritten into a pragma Check later on, and the call will be made when processing the rewritten pragma). (Analyze_Pragma, case Pragma_Check): Omit call to Set_SCO_Pragma_Enabled if Split_PPC is set. 2012-12-05 Olivier Hainque <hainque@adacore.com> * tracebak.c: Add partial support for Lynx178. 2012-12-05 Hristian Kirtchev <kirtchev@adacore.com> * sem_attr.adb (Analyze_Attribute): Improve the error message related to loop assertions. 2012-12-05 Gary Dismukes <dismukes@adacore.com> * atree.ads: Minor reformatting. From-SVN: r194211
Diffstat (limited to 'gcc/ada/get_scos.adb')
-rw-r--r--gcc/ada/get_scos.adb68
1 files changed, 37 insertions, 31 deletions
diff --git a/gcc/ada/get_scos.adb b/gcc/ada/get_scos.adb
index 4fb0010..0020bea 100644
--- a/gcc/ada/get_scos.adb
+++ b/gcc/ada/get_scos.adb
@@ -28,8 +28,8 @@ pragma Ada_2005;
-- read SCO information from ALI files (Xcov and sco_test). Ada 2005
-- constructs may therefore be used freely (and are indeed).
+with Namet; use Namet;
with SCOs; use SCOs;
-with Snames; use Snames;
with Types; use Types;
with Ada.IO_Exceptions; use Ada.IO_Exceptions;
@@ -203,6 +203,8 @@ procedure Get_SCOs is
N : Natural;
-- Scratch buffer, and index into it
+ Nam : Name_Id;
+
-- Start of processing for Get_Scos
begin
@@ -308,7 +310,6 @@ begin
declare
Typ : Character;
Key : Character;
- Pid : Pragma_Id;
begin
Key := 'S';
@@ -327,7 +328,7 @@ begin
-- Loop through items on one line
loop
- Pid := Unknown_Pragma;
+ Nam := No_Name;
Typ := Nextc;
case Typ is
@@ -348,25 +349,16 @@ begin
Skipc;
if Typ = 'P' or else Typ = 'p' then
if Nextc not in '1' .. '9' then
- N := 1;
+ Name_Len := 0;
loop
- Buf (N) := Getc;
+ Name_Len := Name_Len + 1;
+ Name_Buffer (Name_Len) := Getc;
exit when Nextc = ':';
- N := N + 1;
end loop;
- Skipc;
-
- begin
- Pid :=
- Pragma_Id'Value ("pragma_" & Buf (1 .. N));
- exception
- when Constraint_Error =>
+ Skipc; -- Past ':'
- -- Pid remains set to Unknown_Pragma
-
- null;
- end;
+ Nam := Name_Find;
end if;
end if;
end case;
@@ -379,13 +371,13 @@ begin
end if;
SCO_Table.Append
- ((C1 => Key,
- C2 => Typ,
- From => Loc1,
- To => Loc2,
- Last => At_EOL,
- Pragma_Sloc => No_Location,
- Pragma_Name => Pid));
+ ((C1 => Key,
+ C2 => Typ,
+ From => Loc1,
+ To => Loc2,
+ Last => At_EOL,
+ Pragma_Sloc => No_Location,
+ Pragma_Aspect_Name => Nam));
if Key = '>' then
Key := 'S';
@@ -397,8 +389,21 @@ begin
-- Decision entry
- when 'E' | 'G' | 'I' | 'P' | 'W' | 'X' =>
+ when 'E' | 'G' | 'I' | 'P' | 'W' | 'X' | 'A' =>
Dtyp := C;
+
+ if C = 'A' then
+ Name_Len := 0;
+ while Nextc /= ' ' loop
+ Name_Len := Name_Len + 1;
+ Name_Buffer (Name_Len) := Getc;
+ end loop;
+ Nam := Name_Find;
+
+ else
+ Nam := No_Name;
+ end if;
+
Skip_Spaces;
-- Output header
@@ -416,12 +421,13 @@ begin
end if;
SCO_Table.Append
- ((C1 => Dtyp,
- C2 => ' ',
- From => Loc,
- To => No_Source_Location,
- Last => False,
- others => <>));
+ ((C1 => Dtyp,
+ C2 => ' ',
+ From => Loc,
+ To => No_Source_Location,
+ Last => False,
+ Pragma_Aspect_Name => Nam,
+ others => <>));
end;
-- Loop through terms in complex expression