From 7eaa7cdf7da806ba900237e34eb11fd580039da3 Mon Sep 17 00:00:00 2001 From: Robert Dewar Date: Mon, 14 Jun 2010 13:01:07 +0000 Subject: ali.adb (Scan_ALI): Implement reading and storing of N lines 2010-06-14 Robert Dewar * 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 --- gcc/ada/ali.adb | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) (limited to 'gcc/ada/ali.adb') 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 -- cgit v1.1