diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-15 10:15:49 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-15 10:15:49 +0000 |
commit | 7734e2ae0892bba59fb23fc710122dbca4ff590d (patch) | |
tree | b323f92ac5c08a17d70389e07bf81bf543063039 /gcc/ada/par_sco.adb | |
parent | 1c274529fc9415135a0e7895cea8389ecc9bb30b (diff) | |
download | gcc-7734e2ae0892bba59fb23fc710122dbca4ff590d.tar.gz |
2009-07-15 Sergey Rybin <rybin@adacore.com>
* tree_in.ads, output.adb, tree_io.ads: Get rid of pragmas Warnings
Off/On for with clause to System.OS_Lib - not needed any more.
2009-07-15 Ed Schonberg <schonberg@adacore.com>
* sem_warn.adb (Warn_On_Constant_Condition): if the constant condition
is a literal of a derived boolean type, it appears as an unchecked
conversion. Retrieve actual value from expression of conversion.
2009-07-15 Robert Dewar <dewar@adacore.com>
* sem_ch3.adb: Minor reformatting
* lib-xref.ads, lib-xref.adb, lib.ads, par_sco.ads, par_sco.adb,
lib-writ.ads, lib-writ.adb: Minor reformatting.
Fix problem with SCO format in ALI files
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149674 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/par_sco.adb')
-rw-r--r-- | gcc/ada/par_sco.adb | 121 |
1 files changed, 63 insertions, 58 deletions
diff --git a/gcc/ada/par_sco.adb b/gcc/ada/par_sco.adb index 3161c53bfdc..e0b5db3421e 100644 --- a/gcc/ada/par_sco.adb +++ b/gcc/ada/par_sco.adb @@ -536,9 +536,10 @@ package body Par_SCO is -- SCO_Output -- ---------------- - procedure SCO_Output (U : Unit_Number_Type) is + procedure SCO_Output is Start : Nat; Stop : Nat; + U : Unit_Number_Type; procedure Output_Range (From : Source_Ptr; To : Source_Ptr); -- Outputs Sloc range in line:col-line:col format (for now we do not @@ -566,10 +567,19 @@ package body Par_SCO is dsco; end if; - -- Find entry in unit table and set Start/Stop bounds in SCO table + -- Loop through entries in the unit table for J in SCO_Unit_Table.First .. SCO_Unit_Table.Last loop - if U = SCO_Unit_Table.Table (J).Unit then + U := SCO_Unit_Table.Table (J).Unit; + + if In_Extended_Main_Source_Unit (Cunit_Entity (U)) then + Write_Info_Initiate ('C'); + Write_Info_Char (' '); + Write_Info_Nat (Dependency_Num (U)); + Write_Info_Char (' '); + Write_Info_Name (Reference_Name (Source_Index (U))); + Write_Info_Terminate; + Start := SCO_Unit_Table.Table (J).Index; if J = SCO_Unit_Table.Last then @@ -578,76 +588,70 @@ package body Par_SCO is Stop := SCO_Unit_Table.Table (J + 1).Index - 1; end if; - exit; - end if; - - -- Seems like we should find the unit, but for now ignore ??? - - return; - end loop; + -- Loop through relevant entries in SCO table, outputting C lines - -- Loop through relevant entries in SCO table, outputting C lines - - while Start <= Stop loop - declare - T : SCO_Table_Entry renames SCO_Table.Table (Start); + while Start <= Stop loop + declare + T : SCO_Table_Entry renames SCO_Table.Table (Start); - begin - Write_Info_Initiate ('C'); - Write_Info_Char (T.C1); + begin + Write_Info_Initiate ('C'); + Write_Info_Char (T.C1); - case T.C1 is + case T.C1 is - -- Statements, entry, exit + -- Statements, entry, exit - when 'S' | 'Y' | 'T' => - Write_Info_Char (' '); - Output_Range (T.From, T.To); + when 'S' | 'Y' | 'T' => + Write_Info_Char (' '); + Output_Range (T.From, T.To); - -- Decision + -- Decision - when 'I' | 'E' | 'W' | 'X' => - if T.C2 = ' ' then - Start := Start + 1; - end if; + when 'I' | 'E' | 'W' | 'X' => + if T.C2 = ' ' then + Start := Start + 1; + end if; - -- Loop through table entries for this decision + -- Loop through table entries for this decision - loop - declare - T : SCO_Table_Entry renames SCO_Table.Table (Start); + loop + declare + T : SCO_Table_Entry renames SCO_Table.Table (Start); - begin - Write_Info_Char (' '); + begin + Write_Info_Char (' '); - if T.C1 = '!' or else - T.C1 = '^' or else - T.C1 = '&' or else - T.C1 = '|' - then - Write_Info_Char (T.C1); + if T.C1 = '!' or else + T.C1 = '^' or else + T.C1 = '&' or else + T.C1 = '|' + then + Write_Info_Char (T.C1); - else - Write_Info_Char (T.C2); - Output_Range (T.From, T.To); - end if; + else + Write_Info_Char (T.C2); + Output_Range (T.From, T.To); + end if; - exit when T.Last; - Start := Start + 1; - end; - end loop; + exit when T.Last; + Start := Start + 1; + end; + end loop; - when others => - raise Program_Error; - end case; + when others => + raise Program_Error; + end case; - Write_Info_Terminate; - end; + Write_Info_Terminate; + end; - exit when Start = Stop; - Start := Start + 1; + exit when Start = Stop; + Start := Start + 1; - pragma Assert (Start <= Stop); + pragma Assert (Start <= Stop); + end loop; + end if; end loop; end SCO_Output; @@ -673,8 +677,9 @@ package body Par_SCO is elsif Nkind (Lu) = N_Package_Body then Traverse_Package_Body (Lu); - -- Ignore subprogram specifications - -- Also for now, ignore generic declarations and instantiations + -- Ignore subprogram specifications, since nothing to cover. + -- Also ignore instantiations, since again, nothing to cover. + -- Also for now, ignore generic declarations ??? else null; |