summaryrefslogtreecommitdiff
path: root/gcc/ada/back_end.adb
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2007-09-27 16:28:50 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2007-09-27 16:28:50 +0000
commit06c4be77f669f874fdea3a0576d675cf0fac315a (patch)
treee54622c690bcc79a191af53be66102c651e122be /gcc/ada/back_end.adb
parentb3f9ab089b0632ef778879bfe4960b27dc55baaa (diff)
downloadgcc-06c4be77f669f874fdea3a0576d675cf0fac315a.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128839 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/back_end.adb')
-rw-r--r--gcc/ada/back_end.adb28
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,