[m-dev.] for review: changes to MLDS

Julien Fischer juliensf at students.cs.mu.oz.au
Thu Feb 1 11:23:11 AEDT 2001


Here is the relative diff again (with -h this time) 

diff -u compiler/ml_code_util.m compiler/ml_code_util.m
--- compiler/ml_code_util.m
+++ compiler/ml_code_util.m
@@ -245,7 +245,6 @@
 
 	% Generate declaration flags for a local variable
 	%
-	%
 :- func ml_gen_local_var_decl_flags = mlds__decl_flags.
 	
 	% Generate declaration flags for a public field
@@ -1569,6 +1568,10 @@
 	{ ml_skip_dummy_argument_types(OutputVarTypes0, OutputVarLvals0,
 		OutputVarTypes, OutputVarLvals) },
 	list__map_foldl(ml_gen_type, OutputVarTypes, MLDS_OutputVarTypes),
+	%
+	% We expect OutputVarlvals0 OutputVarTypes0 to be empty if
+	% `--nondet-copy-out' is not enabled.
+	%
 	ml_gen_var_lval("cont", mlds__cont_type(MLDS_OutputVarTypes), ContLval),
 	ml_gen_var_lval("cont_env_ptr", mlds__generic_env_ptr_type,
 		ContEnvLval),
diff -u compiler/ml_type_gen.m compiler/ml_type_gen.m
--- compiler/ml_type_gen.m
+++ compiler/ml_type_gen.m
@@ -50,7 +50,7 @@
 
 	% Return the declaration flags appropriate for a member of a class
 	% that was transformed from a special predicate.  These differ 
-	% from normal members in that their finality is final.
+	% from normal members in that their finality is `final'.
 	%
 :- func ml_gen_special_member_decl_flags = mlds__decl_flags.
 %-----------------------------------------------------------------------------%
diff -u compiler/ml_unify_gen.m compiler/ml_unify_gen.m
--- compiler/ml_unify_gen.m
+++ compiler/ml_unify_gen.m
@@ -307,8 +307,8 @@
 		% If this argument is something that would normally be allocated
 		% on the heap, just generate a reference to the static constant
 		% that we must have already generated for it.
-		% XXX This is probably wrong when `--high-level-data' is 
-		%     enabled.
+		% XXX Using mdls__array_type(mlds__generic_type) is probably 
+		% wrong when `--high-level-data' is enabled.
 		%
 		{ ConstType = mlds__array_type(mlds__generic_type) },	
 		ml_gen_static_const_addr(Var, ConstType, ConstAddrRval),
@@ -1018,8 +1018,8 @@
 
 		%
 		% Generate a local static constant for this term.
-		% XXX This is probably wrong when `--high-level-data'
-		%     is enabled.
+		% XXX Using mdls__array_type(mlds__generic_type) is probably 
+		% wrong when `--high-level-data' is enabled.
 		%
 		ml_gen_static_const_name(Var, ConstName),
 		{ ConstType = mlds__array_type(mlds__generic_type) },
reverted:
--- compiler/ml_util.m	2001/01/31 01:41:58
+++ compiler/ml_util.m	2001/01/11 14:25:39	1.5
@@ -68,8 +68,8 @@
 :- pred defn_is_public(mlds__defn).
 :- mode defn_is_public(in) is semidet.
 
+%-----------------------------------------------------------------------------%
 
-%-----------------------------------------------------------------------------%
 :- implementation.
 
 :- import_module rtti.
diff -u compiler/mlds.m compiler/mlds.m
--- compiler/mlds.m
+++ compiler/mlds.m
@@ -550,10 +550,11 @@
 	;	mlds__rtti_type(rtti_name)
 
 		% A type used internally by the ML code generator to 
-		% mark variables whose type is yet to be generated.  This
-		% occurs once in ml_code_util.m where env_ptr's are created,
-		% but their type remains unknown until the ml_elim_nested.m
-		% pass.  
+		% for references to variables that have yet to be
+		% declared.  This occurs once in ml_code_util.m where
+		% references to env_ptr's are generated but the declaration
+		% of these env_ptr's does not occur until the ml_elim_nested
+		% pass.
 	;	mlds__unknown_type.
 
 :- type mercury_type == prog_data__type.
diff -u compiler/mlds_to_c.m compiler/mlds_to_c.m
--- compiler/mlds_to_c.m
+++ compiler/mlds_to_c.m
@@ -633,7 +633,8 @@
 mlds_output_pragma_export_type(prefix, mlds__rtti_type(_)) -->
 	io__write_string("MR_Word").
 mlds_output_pragma_export_type(prefix, mlds__unknown_type) -->
-	{ error("mlds_to_c.m: prefix has unknown type") }. 
+	{ unexpected(this_file, 
+		"mlds_output_pragma_export_type: unknown_type") }. 
 
 	%
 	% Output the definition body for a pragma export
@@ -1708,7 +1709,8 @@
 		[]
 	).
 mlds_output_type_suffix(mlds__unknown_type, _) -->
-	{ error("mlds_to_c.m: suffix has unknown type") }.
+	{ unexpected(this_file,
+		"mlds_output_type_suffix: unknown_type") }.
 
 :- pred mlds_output_array_type_suffix(initializer_array_size::in,
 		io__state::di, io__state::uo) is det.
diff -u compiler/mlds_to_il.m compiler/mlds_to_il.m
--- compiler/mlds_to_il.m
+++ compiler/mlds_to_il.m
@@ -1815,8 +1815,7 @@
 	).
 
 mlds_type_to_ilds_type(mlds__unknown_type) = _ :-
-	 error("mlds_to_il.m: unknown type").	
-
+	unexpected(this_file, "mlds_type_to_ilds_type: unknown_type").
 %-----------------------------------------------------------------------------
 %
 % Name mangling.
only in patch2:
--- compiler/rtti_to_mlds.m	2001/01/16 03:24:39	1.11
+++ compiler/rtti_to_mlds.m	2001/01/31 05:17:51
@@ -564,7 +564,11 @@
 gen_init_builtin_const(Name) = init_obj(Rval) :-
         mercury_private_builtin_module(PrivateBuiltin),
 	MLDS_Module = mercury_module_name_to_mlds(PrivateBuiltin),
-	Rval = lval(var(qual(MLDS_Module, Name))).
+	% XXX These are actually enumeration constants.
+	% Perhaps we should be using an enumeration type here,
+	% rather than `mlds__native_int_type'.
+	Type = mlds__native_int_type,
+	Rval = lval(var(qual(MLDS_Module, Name), Type)).
 
 %-----------------------------------------------------------------------------%
 %


--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list