diff options
author | Robert Dewar <dewar@adacore.com> | 2010-06-14 13:01:07 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-06-14 15:01:07 +0200 |
commit | 7eaa7cdf7da806ba900237e34eb11fd580039da3 (patch) | |
tree | 098473a5e47938dcfa8b53ff687d42c7e5548626 /gcc/ada/ali.adb | |
parent | 3a13e78582d1be59cd9e5ecb24f8f1c355261648 (diff) | |
download | gcc-7eaa7cdf7da806ba900237e34eb11fd580039da3.zip gcc-7eaa7cdf7da806ba900237e34eb11fd580039da3.tar.gz gcc-7eaa7cdf7da806ba900237e34eb11fd580039da3.tar.bz2 |
ali.adb (Scan_ALI): Implement reading and storing of N lines
2010-06-14 Robert Dewar <dewar@adacore.com>
* ali.adb (Scan_ALI): Implement reading and storing of N lines
(Known_ALI_Lines): Add entry for 'N' (notes)
* ali.ads (Notes): New table to store Notes information
* alloc.ads: Add entries for Notes table
* lib-util.adb (Write_Info_Int): New procedure
(Write_Info_Slit): New procedure
(Write_Info_Uint): New procedure
* lib-util.ads (Write_Info_Int): New procedure
(Write_Info_Slit): New procedure
(Write_Info_Uint): New procedure
* lib-writ.adb (Write_Unit_Information): Output N (notes) lines
* lib-writ.ads: Update documentation for N (Notes) lines
* lib.adb (Store_Note): New procedure
* lib.ads (Notes): New table
(Store_Note): New procedure
* sem_prag.adb: Call Store_Note for affected pragmas
From-SVN: r160736
Diffstat (limited to 'gcc/ada/ali.adb')
-rw-r--r-- | gcc/ada/ali.adb | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/gcc/ada/ali.adb b/gcc/ada/ali.adb index a004956..27144b9 100644 --- a/gcc/ada/ali.adb +++ b/gcc/ada/ali.adb @@ -49,6 +49,7 @@ package body ALI is 'U' => True, -- unit 'W' => True, -- with 'L' => True, -- linker option + 'N' => True, -- notes 'E' => True, -- external 'D' => True, -- dependency 'X' => True, -- xref @@ -89,14 +90,16 @@ package body ALI is Withs.Init; Sdep.Init; Linker_Options.Init; + Notes.Init; Xref_Section.Init; Xref_Entity.Init; Xref.Init; Version_Ref.Reset; - -- Add dummy zero'th item in Linker_Options for the sort function + -- Add dummy zero'th item in Linker_Options and Notes for sort calls Linker_Options.Increment_Last; + Notes.Increment_Last; -- Initialize global variables recording cumulative options in all -- ALI files that are read for a given processing run in gnatbind. @@ -1862,6 +1865,45 @@ package body ALI is Linker_Options.Table (Linker_Options.Last).Original_Pos := Linker_Options.Last; end if; + + -- If there are notes present, scan them + + Notes_Loop : loop + Check_Unknown_Line; + exit Notes_Loop when C /= 'N'; + + if Ignore ('N') then + Skip_Line; + + else + Checkc (' '); + + Notes.Increment_Last; + Notes.Table (Notes.Last).Pragma_Type := Getc; + Notes.Table (Notes.Last).Pragma_Line := Get_Nat; + Checkc (':'); + Notes.Table (Notes.Last).Pragma_Col := Get_Nat; + Notes.Table (Notes.Last).Unit := Units.Last; + + if At_Eol then + Notes.Table (Notes.Last).Pragma_Args := No_Name; + + else + Checkc (' '); + + Name_Len := 0; + while not At_Eol loop + Add_Char_To_Name_Buffer (Getc); + end loop; + + Notes.Table (Notes.Last).Pragma_Args := Name_Enter; + end if; + + Skip_Eol; + end if; + + C := Getc; + end loop Notes_Loop; end loop U_Loop; -- End loop through units for one ALI file |