diff: module qualification of labels

Simon TAYLOR stayl at students.cs.mu.oz.au
Mon Jul 14 12:07:07 AEST 1997


Hi Fergus,

Could you please review this.

Simon.


Estimated hours taken: 0.25

compiler/llds_out.m
compiler/fact_table.m
compiler/opt_debug.m
	Renamed llds_out__maybe_qualify_label to llds_out__qualify_label.
	llds_out__maybe_qualify_label didn't qualify the name if it was of 
	the form Module__Name. Now that we parse '__' as a module qualifier,
	it should always qualify the label.


Index: fact_table.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/fact_table.m,v
retrieving revision 1.8
diff -u -r1.8 fact_table.m
--- fact_table.m	1997/05/29 23:45:17	1.8
+++ fact_table.m	1997/07/14 00:40:17
@@ -2398,7 +2398,7 @@
 make_fact_table_identifier(qualified(ModuleName, PredName), Identifier) :-
 	llds_out__name_mangle(ModuleName, MangledModuleName),
 	llds_out__name_mangle(PredName, MangledPredName),
-	llds_out__maybe_qualify_name(MangledModuleName, MangledPredName,
+	llds_out__qualify_name(MangledModuleName, MangledPredName,
 		Identifier).
 
 make_fact_table_identifier(unqualified(PredName), Identifier) :-
Index: llds_out.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/llds_out.m,v
retrieving revision 1.49
diff -u -r1.49 llds_out.m
--- llds_out.m	1997/06/29 23:10:53	1.49
+++ llds_out.m	1997/07/14 00:38:55
@@ -65,8 +65,8 @@
 	% Produces a string of the form Module__Name, unless Module__
 	% is already a prefix of Name.
 
-:- pred llds_out__maybe_qualify_name(string, string, string).
-:- mode llds_out__maybe_qualify_name(in, in, out) is det.
+:- pred llds_out__qualify_name(string, string, string).
+:- mode llds_out__qualify_name(in, in, out) is det.
 
 :- pred output_c_quoted_string(string, io__state, io__state).
 :- mode output_c_quoted_string(in, di, uo) is det.
@@ -2196,9 +2196,9 @@
 	% we need to qualify it with both the module name of the
 	% type, and also (if it is different) the module name of the
 	% current module.
-	llds_out__maybe_qualify_name(MangledTypeModule, MangledTypeName,
+	llds_out__qualify_name(MangledTypeModule, MangledTypeName,
 		QualifiedMangledTypeName),
-	llds_out__maybe_qualify_name(MangledModule, QualifiedMangledTypeName,
+	llds_out__qualify_name(MangledModule, QualifiedMangledTypeName,
 		FullyQualifiedMangledTypeName),
 
 	% join it all together
@@ -2227,7 +2227,7 @@
 	->
 		LabelName0 = Name0
 	;
-		llds_out__maybe_qualify_name(DeclaringModule, Name0,
+		llds_out__qualify_name(DeclaringModule, Name0,
 			LabelName0)
 	),
 	(
@@ -2862,13 +2862,8 @@
 		string__append("f", Name0, Name)
 	).
 
-llds_out__maybe_qualify_name(Module0, Name0, Name) :-
-	string__append(Module0, "__", UnderscoresModule),
-	( string__append(UnderscoresModule, _, Name0) ->
-		Name = Name0
-	;
-		string__append(UnderscoresModule, Name0, Name)
-	).
+llds_out__qualify_name(Module0, Name0, Name) :-
+	string__append_list([Module0, "__", Name0], Name).
 
 	% A table used to convert Mercury functors into
 	% C identifiers.  Feel free to add any new translations you want.
Index: opt_debug.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/opt_debug.m,v
retrieving revision 1.68
diff -u -r1.68 opt_debug.m
--- opt_debug.m	1997/04/17 07:49:11	1.68
+++ opt_debug.m	1997/07/14 00:40:34
@@ -775,7 +775,7 @@
 	string__int_to_string(Arity, A_str),
 	proc_id_to_int(ProcId, Mode),
 	string__int_to_string(Mode, M_str),
-	llds_out__maybe_qualify_name(TypeModule, Type, TypeName),
+	llds_out__qualify_name(TypeModule, Type, TypeName),
 	string__append_list([Module, "_", Pred, "_",
 		TypeName, "_", A_str, "_", M_str], Str).
 



More information about the developers mailing list