This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] distinguish by different types string types


Tested on i686-linux, committed on trunk

This patch is to distinguish by different types simple names (Name_Id),
simple file names (File_Name_Type), unit names (Unit_Name_Type) and path
names (Path_Name_Type). There is no changed of functionality.

Also, add extra flags for future use.

Finally, the use of file names with special characters as non-standard source
file names (notably parens) caused infinite loops in both gnatbind and
gnatlink. This patch corrects that anomoly:

The following is a test program

package Pkg is
end;

with Pkg;
procedure Main is
begin
   null;
end;

Put the spec of Pkg in a file called toto.ada(1), and create a gnat.adc
file that contains:

pragma Source_File_Name
  (Pkg,
   Spec_File_Name => "toto.ada(1)");

The Main procedure goes in main.adb as usual

Now compile using:

gcc -c -x ada "toto.ada(1)"
gcc -c main.adb
gnatbind main.ali
gnatlink main.ali
main

This should compile and execute quietly. Previous to this patch,
the gnatbind step would hang in an infinite loop

2007-06-06  Vincent Celier  <celier@adacore.com>
	    Robert Dewar  <dewar@adacore.com>

	* bcheck.adb, binde.adb, binderr.adb, binderr.ads, butil.adb, 
	butil.ads, erroutc.adb, erroutc.ads, errutil.adb, errutil.ads, 
	err_vars.ads, exp_tss.adb, exp_tss.ads, fmap.adb, fmap.ads, 
	fname.adb, fname.ads, fname-sf.adb, fname-uf.adb, fname-uf.ads, 
	lib-sort.adb, lib-util.adb, lib-util.ads, lib-xref.adb, makeutl.ads, 
	makeutl.adb, nmake.adt, osint.adb, osint.ads, osint-b.adb, 
	par-load.adb, prj-attr.adb, prj-dect.adb, prj-err.adb, prj-makr.adb, 
	prj-part.adb, prj-pp.adb, prj-proc.adb, prj-tree.adb, prj-tree.ads, 
	prj-util.adb, prj-util.ads, scans.adb, scans.ads, sem_ch2.adb, 
	sinput-c.adb, styleg-c.adb, tempdir.adb, tempdir.ads, uname.adb, 
	uname.ads, atree.h, atree.ads, atree.adb, ali-util.ads, ali-util.adb,
	ali.ads, ali.adb: 
	Move Name_Id, File_Name_Type and Unit_Name_Type from package Types to
	package Namet. Make File_Name_Type and Unit_Name_Type types derived from
	Mame_Id. Add new type Path_Name_Type, also derived from Name_Id.
	Use variables of types File_Name_Type and Unit_Name_Type in error
	messages.
	(Get_Name): Add parameter Ignore_Special, and set it reading file name
	(New_Copy): When debugging the compiler, call New_Node_Debugging_Output
	here.
	Define flags Flag217-Flag230 with associated subprograms
	(Flag_Word5): New record type.
	(Flag_Word5_Ptr): New access type.
	(To_Flag_Word5): New unchecked conversion.
	(To_Flag_Word5_Ptr): Likewise.
	(Flag216): New function.
	(Set_Flag216): New procedure.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]