diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2007-09-27 16:28:50 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2007-09-27 16:28:50 +0000 |
commit | c304878307f81a770edb0ec08d88c73b5aed074a (patch) | |
tree | e54622c690bcc79a191af53be66102c651e122be /gcc/ada/back_end.adb | |
parent | 3c1eb9eb6c8cf087a78774d6f3a1d7e1eaf1d036 (diff) | |
download | gcc-c304878307f81a770edb0ec08d88c73b5aed074a.tar.gz |
Mapped location support
Mapped location support
* back_end.adb (Call_Back_End): Pass information about source
files instead of units to gigi.
* gigi.h (struct File_Info_Type): New.
(gigi): Rename and change type of number_units parameter, change
type of file_info_ptr parameter.
* trans.c (number_files): New global variable.
(gigi): Rename and change type of number_units parameter, change
type of file_info_ptr parameter.
If mapped location support is enabled, create the isomorphic mapping
between source files and line maps.
(Sloc_to_locus): If mapped location support is enabled, translate
source location into mapped location.
(annotate_with_node): Rename into set_expr_location_from_node.
Call set_expr_location instead of annotate_with_locus.
(Pragma_to_gnu): Adjust for above change.
(Loop_Statement_to_gnu): Likewise.
(call_to_gnu): Likewise.
(Handled_Sequence_Of_Statements_to_gnu): Likewise.
(gnat_to_gnu): Likewise.
(add_stmt_with_node): Likewise.
(add_cleanup): Likewise.
* utils.c (gnat_init_decl_processing): Do not set input_line.
From-SVN: r128839
Diffstat (limited to 'gcc/ada/back_end.adb')
-rw-r--r-- | gcc/ada/back_end.adb | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/gcc/ada/back_end.adb b/gcc/ada/back_end.adb index 0ea228d846a..4f7a41134bb 100644 --- a/gcc/ada/back_end.adb +++ b/gcc/ada/back_end.adb @@ -48,19 +48,16 @@ package body Back_End is procedure Call_Back_End (Mode : Back_End_Mode_Type) is - -- The File_Record type has a lot of components that are meaningless - -- to the back end, so a new record is created here to contain the - -- needed information for each file. + -- The Source_File_Record type has a lot of components that are + -- meaningless to the back end, so a new record type is created + -- here to contain the needed information for each file. - type Needed_File_Info_Type is record + type File_Info_Type is record File_Name : File_Name_Type; - First_Sloc : Source_Ptr; - Last_Sloc : Source_Ptr; Num_Source_Lines : Nat; end record; - File_Info_Array : - array (Main_Unit .. Last_Unit) of Needed_File_Info_Type; + File_Info_Array : array (1 .. Last_Source_File) of File_Info_Type; procedure gigi ( gnat_root : Int; @@ -76,7 +73,7 @@ package body Back_End is strings_ptr : Address; string_chars_ptr : Address; list_headers_ptr : Address; - number_units : Int; + number_file : Nat; file_info_ptr : Address; gigi_standard_integer : Entity_Id; @@ -86,8 +83,6 @@ package body Back_End is pragma Import (C, gigi); - S : Source_File_Index; - begin -- Skip call if in -gnatdH mode @@ -95,12 +90,9 @@ package body Back_End is return; end if; - for J in Main_Unit .. Last_Unit loop - S := Source_Index (J); - File_Info_Array (J).File_Name := File_Name (S); - File_Info_Array (J).First_Sloc := Source_Text (S)'First; - File_Info_Array (J).Last_Sloc := Source_Text (S)'Last; - File_Info_Array (J).Num_Source_Lines := Num_Source_Lines (S); + for I in 1 .. Last_Source_File loop + File_Info_Array (I).File_Name := Full_Debug_Name (I); + File_Info_Array (I).Num_Source_Lines := Num_Source_Lines (I); end loop; gigi ( @@ -117,7 +109,7 @@ package body Back_End is strings_ptr => Strings_Address, string_chars_ptr => String_Chars_Address, list_headers_ptr => Lists_Address, - number_units => Num_Units, + number_file => Num_Source_Files, file_info_ptr => File_Info_Array'Address, gigi_standard_integer => Standard_Integer, |