[m-rev.] for review:
Zoltan Somogyi
zs at csse.unimelb.edu.au
Fri Jul 28 17:51:39 AEST 2006
Implement the trace goal construct for the hlc grades.
compiler/mlds.m:
Extend the MLDS in a similar way to how the previous diff extended
the LLDS. This means extending lvals to allow references to global
variables representing the initial snapshots of environment variables,
and recording the set of environment variables referred to by each
definition.
compiler/mlds_to_c.m:
Handle the extensions to the MLDS.
compiler/llds_out.m:
util/mkinit.c:
Note that mlds_to_c.m now also depends on the naming scheme for the
global variables representing environment variables.
compiler/ml_code_gen.m:
When generating code for a procedure, remember the set of environment
variables it refers to.
When generating code for the special form of call_foreign_proc created
by the transformation of trace goals with runtime conditions by
simplify.m, generate the appropriate boolean expression involving
references to environment variables.
compiler/ml_code_util.m:
Provide storage space for recording the set of environment variables
used in functions.
compiler/mlds_to_il.m:
compiler/mlds_to_gcc.m:
compiler/mlds_to_java.m:
compiler/mlds_to_managed.m:
Abort if asked to translate functions that include references to
environment variables, since this is preferable to silently doing
the wrong thing.
compiler/*.m:
Misc changes required to conform to the change to the MLDS.
Zoltan.
cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/llds_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/llds_out.m,v
retrieving revision 1.284
diff -u -b -r1.284 llds_out.m
--- compiler/llds_out.m 28 Jul 2006 05:08:09 -0000 1.284
+++ compiler/llds_out.m 28 Jul 2006 05:08:23 -0000
@@ -5228,7 +5228,8 @@
% The calls to env_var_is_acceptable_char in prog_io_goal.m ensure that
% EnvVarName is acceptable as part of a C identifier.
-% The prefix must be identical to envvar_prefix in util/mkinit.c.
+% The prefix must be identical to envvar_prefix in util/mkinit.c and
+% global_var_name in mlds_to_c.m.
c_global_var_name(env_var_ref(EnvVarName)) = "mercury_envvar_" ++ EnvVarName.
%-----------------------------------------------------------------------------%
Index: compiler/ml_code_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_code_gen.m,v
retrieving revision 1.181
diff -u -b -r1.181 ml_code_gen.m
--- compiler/ml_code_gen.m 28 Jul 2006 05:08:10 -0000 1.181
+++ compiler/ml_code_gen.m 28 Jul 2006 07:16:25 -0000
@@ -1426,7 +1426,8 @@
Decls = list.append(MLDS_LocalVars, Decls0),
Statement = ml_gen_block(Decls, Statements, Context),
FunctionBody = body_defined_here(Statement)
- )
+ ),
+ ml_gen_info_get_env_vars(!.Info, EnvVarNames)
),
pred_info_get_attributes(PredInfo, Attributes),
@@ -1435,7 +1436,7 @@
MLDS_Attributes = attributes_to_mlds_attributes(ModuleInfo, AttributeList),
ProcDefnBody = mlds_function(yes(proc(PredId, ProcId)), MLDS_Params,
- FunctionBody, MLDS_Attributes).
+ FunctionBody, MLDS_Attributes, EnvVarNames).
% For model_det and model_semi procedures, figure out which output
% variables are returned by value (rather than being passed by reference)
@@ -2231,8 +2232,6 @@
ml_gen_goal_expr(call_foreign_proc(Attributes, PredId, ProcId, Args, ExtraArgs,
MaybeTraceRuntimeCond, PragmaImpl), CodeModel, OuterContext,
Decls, Statements, !Info) :-
- require(unify(MaybeTraceRuntimeCond, no),
- "ml_gen_goal_expr: MaybeTraceRuntimeCond NYI"),
(
PragmaImpl = fc_impl_ordinary(ForeignCode, MaybeContext),
(
@@ -2241,15 +2240,24 @@
MaybeContext = no,
Context = OuterContext
),
+ (
+ MaybeTraceRuntimeCond = no,
ml_gen_ordinary_pragma_foreign_proc(CodeModel, Attributes,
PredId, ProcId, Args, ExtraArgs, ForeignCode,
Context, Decls, Statements, !Info)
;
+ MaybeTraceRuntimeCond = yes(TraceRuntimeCond),
+ ml_gen_trace_runtime_cond(TraceRuntimeCond, Context,
+ Decls, Statements, !Info)
+ )
+ ;
PragmaImpl = fc_impl_model_non(LocalVarsDecls, LocalVarsContext,
FirstCode, FirstContext, LaterCode, LaterContext,
_Treatment, SharedCode, SharedContext),
expect(unify(ExtraArgs, []), this_file,
"ml_gen_goal_expr: extra args"),
+ require(unify(MaybeTraceRuntimeCond, no),
+ "ml_gen_goal_expr: MaybeTraceRuntimeCond"),
ml_gen_nondet_pragma_foreign_proc(CodeModel, Attributes,
PredId, ProcId, Args, OuterContext,
LocalVarsDecls, LocalVarsContext,
@@ -2259,6 +2267,8 @@
PragmaImpl = fc_impl_import(Name, HandleReturn, Vars, _Context),
expect(unify(ExtraArgs, []), this_file,
"ml_gen_goal_expr: extra args"),
+ require(unify(MaybeTraceRuntimeCond, no),
+ "ml_gen_goal_expr: MaybeTraceRuntimeCond"),
ForeignCode = string.append_list([HandleReturn, " ",
Name, "(", Vars, ");"]),
ml_gen_ordinary_pragma_foreign_proc(CodeModel, Attributes,
@@ -2454,6 +2464,43 @@
]),
Decls = ConvDecls.
+:- pred ml_gen_trace_runtime_cond(trace_expr(trace_runtime)::in,
+ term.context::in, mlds_defns::out, statements::out,
+ ml_gen_info::in, ml_gen_info::out) is det.
+
+ml_gen_trace_runtime_cond(TraceRuntimeCond, Context, Decls, Statements,
+ !Info) :-
+ Decls = [],
+ MLDSContext = mlds_make_context(Context),
+ ml_success_lval(!.Info, SuccessLval),
+ ml_generate_runtime_cond_code(TraceRuntimeCond, CondRval, !Info),
+ Statement = statement(atomic(assign(SuccessLval, CondRval)), MLDSContext),
+ Statements = [Statement].
+
+:- pred ml_generate_runtime_cond_code(trace_expr(trace_runtime)::in,
+ mlds_rval::out, ml_gen_info::in, ml_gen_info::out) is det.
+
+ml_generate_runtime_cond_code(Expr, CondRval, !Info) :-
+ (
+ Expr = trace_base(trace_envvar(EnvVar)),
+ ml_gen_info_add_env_var_name(EnvVar, !Info),
+ EnvVarRval = lval(global_var_ref(env_var_ref(EnvVar))),
+ ZeroRval = const(int_const(0)),
+ CondRval = binop(ne, EnvVarRval, ZeroRval)
+ ;
+ Expr = trace_op(TraceOp, ExprA, ExprB),
+ ml_generate_runtime_cond_code(ExprA, RvalA, !Info),
+ ml_generate_runtime_cond_code(ExprB, RvalB, !Info),
+ (
+ TraceOp = trace_or,
+ Op = logical_or
+ ;
+ TraceOp = trace_and,
+ Op = logical_and
+ ),
+ CondRval = binop(Op, RvalA, RvalB)
+ ).
+
:- pred ml_gen_ordinary_pragma_foreign_proc(code_model::in,
pragma_foreign_proc_attributes::in, pred_id::in, proc_id::in,
list(foreign_arg)::in, list(foreign_arg)::in, string::in,
Index: compiler/ml_code_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_code_util.m,v
retrieving revision 1.111
diff -u -b -r1.111 ml_code_util.m
--- compiler/ml_code_util.m 28 Jul 2006 05:08:11 -0000 1.111
+++ compiler/ml_code_util.m 28 Jul 2006 07:13:43 -0000
@@ -32,6 +32,7 @@
:- import_module list.
:- import_module map.
:- import_module maybe.
+:- import_module set.
%-----------------------------------------------------------------------------%
%
@@ -724,6 +725,16 @@
%
:- pred ml_gen_info_get_extra_defns(ml_gen_info::in, mlds_defns::out) is det.
+ % Add the given string as the name of an environment variable used by
+ % the function being generated.
+ %
+:- pred ml_gen_info_add_env_var_name(string::in,
+ ml_gen_info::in, ml_gen_info::out) is det.
+
+ % Get the names of the used environment variables.
+ %
+:- pred ml_gen_info_get_env_vars(ml_gen_info::in, set(string)::out) is det.
+
%-----------------------------------------------------------------------------%
%-----------------------------------------------------------------------------%
@@ -750,7 +761,6 @@
:- import_module counter.
:- import_module pair.
-:- import_module set.
:- import_module stack.
:- import_module string.
:- import_module term.
@@ -933,8 +943,9 @@
DeclFlags = ml_gen_label_func_decl_flags,
MaybePredProcId = no,
Attributes = [],
+ EnvVarNames = set.init,
FuncDefn = mlds_function(MaybePredProcId, FuncParams,
- body_defined_here(Statement), Attributes),
+ body_defined_here(Statement), Attributes, EnvVarNames),
Func = mlds_defn(FuncName, mlds_make_context(Context), DeclFlags,
FuncDefn).
@@ -1822,7 +1833,7 @@
(
Defn = mlds_defn(EntityName, _, _, EntityDefn),
EntityName = entity_function(PredLabel, ProcId, yes(SeqNum), _),
- EntityDefn = mlds_function(_, _, body_defined_here(_), _)
+ EntityDefn = mlds_function(_, _, body_defined_here(_), _, _)
->
% We call the proxy function.
ProcLabel = mlds_proc_label(PredLabel, ProcId),
@@ -2390,7 +2401,8 @@
% constants which should be inserted
% before the definition of the function
% for the current procedure.
- extra_defns :: mlds_defns
+ extra_defns :: mlds_defns,
+ env_var_names :: set(string)
).
ml_gen_info_init(ModuleInfo, PredId, ProcId) = Info :-
@@ -2421,6 +2433,7 @@
stack.init(SuccContStack),
map.init(VarLvals),
ExtraDefns = [],
+ EnvVarNames = set.init,
Info = ml_gen_info(
ModuleInfo,
@@ -2439,7 +2452,8 @@
ConstNumMap,
SuccContStack,
VarLvals,
- ExtraDefns
+ ExtraDefns,
+ EnvVarNames
).
ml_gen_info_get_module_info(Info, Info ^ module_info).
@@ -2547,6 +2561,13 @@
ml_gen_info_get_extra_defns(Info, Info ^ extra_defns).
+ml_gen_info_add_env_var_name(Name, !Info) :-
+ EnvVarNames0 = !.Info ^ env_var_names,
+ set.insert(EnvVarNames0, Name, EnvVarNames),
+ !:Info = !.Info ^ env_var_names := EnvVarNames.
+
+ml_gen_info_get_env_vars(Info, Info ^ env_var_names).
+
%-----------------------------------------------------------------------------%
select_output_vars(ModuleInfo, HeadVars, HeadModes, VarTypes) = OutputVars :-
Index: compiler/ml_elim_nested.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_elim_nested.m,v
retrieving revision 1.81
diff -u -b -r1.81 ml_elim_nested.m
--- compiler/ml_elim_nested.m 28 Jul 2006 05:08:11 -0000 1.81
+++ compiler/ml_elim_nested.m 28 Jul 2006 07:03:19 -0000
@@ -460,6 +460,7 @@
:- import_module list.
:- import_module pair.
:- import_module maybe.
+:- import_module set.
:- import_module solutions.
:- import_module string.
@@ -502,7 +503,7 @@
Defn0 = mlds_defn(Name, Context, Flags, DefnBody0),
(
DefnBody0 = mlds_function(PredProcId, Params0,
- body_defined_here(FuncBody0), Attributes),
+ body_defined_here(FuncBody0), Attributes, EnvVarNames),
% Don't add GC tracing code to the gc_trace/1 primitive!
% (Doing so would just slow things down unnecessarily.)
\+ (
@@ -653,7 +654,7 @@
),
Params = mlds_func_params(Arguments, RetValues),
DefnBody = mlds_function(PredProcId, Params,
- body_defined_here(FuncBody), Attributes),
+ body_defined_here(FuncBody), Attributes, EnvVarNames),
Defn = mlds_defn(Name, Context, Flags, DefnBody),
Defns = list.append(HoistedDefns, [Defn])
;
@@ -1011,8 +1012,9 @@
DeclFlags = ml_gen_gc_trace_func_decl_flags,
MaybePredProcId = no,
Attributes = [],
+ EnvVarNames = set.init,
FuncDefn = mlds_function(MaybePredProcId, FuncParams,
- body_defined_here(Statement), Attributes),
+ body_defined_here(Statement), Attributes, EnvVarNames),
GCTraceFuncDefn = mlds_defn(GCTraceFuncName, Context, DeclFlags,
FuncDefn).
@@ -1101,7 +1103,7 @@
Defn0 = mlds_defn(Name, Context, Flags, DefnBody0),
(
DefnBody0 = mlds_function(PredProcId, Params,
- body_defined_here(FuncBody0), Attributes),
+ body_defined_here(FuncBody0), Attributes, EnvVarNames),
statement_contains_var(FuncBody0, qual(ModuleName, module_qual,
var(mlds_var_name("env_ptr", no))))
->
@@ -1119,7 +1121,7 @@
FuncBody = statement(block([EnvPtrDecl],
[InitEnvPtr, FuncBody0]), Context),
DefnBody = mlds_function(PredProcId, Params,
- body_defined_here(FuncBody), Attributes),
+ body_defined_here(FuncBody), Attributes, EnvVarNames),
Defn = mlds_defn(Name, Context, Flags, DefnBody),
Init = yes
;
@@ -1541,7 +1543,8 @@
Defns, InitStatements, !Info) :-
Defn0 = mlds_defn(Name, Context, Flags0, DefnBody0),
(
- DefnBody0 = mlds_function(PredProcId, Params, FuncBody0, Attributes),
+ DefnBody0 = mlds_function(PredProcId, Params, FuncBody0, Attributes,
+ EnvVarNames),
% Recursively flatten the nested function.
flatten_function_body(FuncBody0, FuncBody, !Info),
@@ -1555,7 +1558,8 @@
;
Flags = Flags0
),
- DefnBody = mlds_function(PredProcId, Params, FuncBody, Attributes),
+ DefnBody = mlds_function(PredProcId, Params, FuncBody, Attributes,
+ EnvVarNames),
Defn = mlds_defn(Name, Context, Flags, DefnBody),
( Action = hoist_nested_funcs ->
% Note that we assume that we can safely hoist stuff inside nested
@@ -1685,7 +1689,7 @@
statements_contains_defn(FollowingStatements, FollowingDefn)
),
(
- FollowingDefn = mlds_defn(_, _, _, mlds_function(_, _, _, _)),
+ FollowingDefn = mlds_defn(_, _, _, mlds_function(_, _, _, _, _)),
defn_contains_var(FollowingDefn, QualDataName)
;
FollowingDefn = mlds_defn(_, _, _, mlds_data(_, Initializer, _)),
@@ -1862,6 +1866,7 @@
fixup_rval(Rval0, Rval, !Info).
fixup_lval(mem_ref(Rval0, Type), mem_ref(Rval, Type), !Info) :-
fixup_rval(Rval0, Rval, !Info).
+fixup_lval(global_var_ref(Ref), global_var_ref(Ref), !Info).
fixup_lval(var(Var0, VarType), VarLval, !Info) :-
fixup_var(Var0, VarType, VarLval, !Info).
@@ -2026,7 +2031,7 @@
% defn_body_contains_defn(mlds_data(_Type, _Initializer, _), _Defn) :- fail.
defn_body_contains_defn(mlds_function(_PredProcId, _Params, FunctionBody,
- _Attrs), Name) :-
+ _Attrs, _EnvVarNames), Name) :-
function_body_contains_defn(FunctionBody, Name).
defn_body_contains_defn(mlds_class(ClassDefn), Name) :-
ClassDefn = mlds_class_defn(_Kind, _Imports, _Inherits, _Implements,
Index: compiler/ml_optimize.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_optimize.m,v
retrieving revision 1.40
diff -u -b -r1.40 ml_optimize.m
--- compiler/ml_optimize.m 28 Jul 2006 05:08:11 -0000 1.40
+++ compiler/ml_optimize.m 28 Jul 2006 06:55:14 -0000
@@ -91,13 +91,15 @@
optimize_in_defn(ModuleName, Globals, Defn0) = Defn :-
Defn0 = mlds_defn(Name, Context, Flags, DefnBody0),
(
- DefnBody0 = mlds_function(PredProcId, Params, FuncBody0, Attributes),
+ DefnBody0 = mlds_function(PredProcId, Params, FuncBody0, Attributes,
+ EnvVarNames),
OptInfo = opt_info(Globals, ModuleName, Name, Params, Context),
FuncBody1 = optimize_func(OptInfo, FuncBody0),
FuncBody = optimize_in_function_body(OptInfo, FuncBody1),
- DefnBody = mlds_function(PredProcId, Params, FuncBody, Attributes),
+ DefnBody = mlds_function(PredProcId, Params, FuncBody, Attributes,
+ EnvVarNames),
Defn = mlds_defn(Name, Context, Flags, DefnBody)
;
DefnBody0 = mlds_data(_, _, _),
@@ -918,9 +920,9 @@
% in the containing scope.
DefnBody = DefnBody0
;
- DefnBody0 = mlds_function(Id, Params, Body0, Attributes),
+ DefnBody0 = mlds_function(Id, Params, Body0, Attributes, EnvVarNames),
eliminate_var_in_function_body(Body0, Body, !VarElimInfo),
- DefnBody = mlds_function(Id, Params, Body, Attributes)
+ DefnBody = mlds_function(Id, Params, Body, Attributes, EnvVarNames)
),
Defn = mlds_defn(Name, Context, Flags, DefnBody).
@@ -1025,6 +1027,9 @@
eliminate_var_in_rval(Rval0, Rval, !VarElimInfo),
Lval = mem_ref(Rval, Type)
;
+ Lval0 = global_var_ref(_Ref),
+ Lval = Lval0
+ ;
Lval0 = var(VarName, _Type),
( VarName = !.VarElimInfo ^ var_name ->
% We found an lvalue occurrence of the variable -- if the variable
Index: compiler/ml_tailcall.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_tailcall.m,v
retrieving revision 1.37
diff -u -b -r1.37 ml_tailcall.m
--- compiler/ml_tailcall.m 28 Jul 2006 05:08:11 -0000 1.37
+++ compiler/ml_tailcall.m 28 Jul 2006 06:55:41 -0000
@@ -141,7 +141,8 @@
mark_tailcalls_in_defn(Defn0) = Defn :-
Defn0 = mlds_defn(Name, Context, Flags, DefnBody0),
(
- DefnBody0 = mlds_function(PredProcId, Params, FuncBody0, Attributes),
+ DefnBody0 = mlds_function(PredProcId, Params, FuncBody0, Attributes,
+ EnvVarNames),
% Compute the initial value of the `Locals' and `AtTail' arguments.
Params = mlds_func_params(Args, RetTypes),
Locals = [params(Args)],
@@ -153,7 +154,8 @@
AtTail = no
),
FuncBody = mark_tailcalls_in_function_body(FuncBody0, AtTail, Locals),
- DefnBody = mlds_function(PredProcId, Params, FuncBody, Attributes),
+ DefnBody = mlds_function(PredProcId, Params, FuncBody, Attributes,
+ EnvVarNames),
Defn = mlds_defn(Name, Context, Flags, DefnBody)
;
DefnBody0 = mlds_data(_, _, _),
@@ -546,7 +548,7 @@
Defn = mlds_defn(Name, _Context, _Flags, DefnBody),
(
DefnBody = mlds_function(_PredProcId, _Params, FuncBody,
- _Attributes),
+ _Attributes, _EnvVarNames),
FuncBody = body_defined_here(Body),
nontailcall_in_statement(ModuleName, Name, Body, Warning)
;
Index: compiler/ml_type_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_type_gen.m,v
retrieving revision 1.54
diff -u -b -r1.54 ml_type_gen.m
--- compiler/ml_type_gen.m 28 Jul 2006 05:08:11 -0000 1.54
+++ compiler/ml_type_gen.m 28 Jul 2006 07:03:29 -0000
@@ -99,6 +99,7 @@
:- import_module map.
:- import_module maybe.
:- import_module pair.
+:- import_module set.
:- import_module string.
:- import_module term.
@@ -770,9 +771,9 @@
Stmt = statement(block([], InitMembers), Context),
Attributes = [],
-
+ EnvVarNames = set.init,
Ctor = mlds_function(no, mlds_func_params(Args, ReturnValues),
- body_defined_here(Stmt), Attributes),
+ body_defined_here(Stmt), Attributes, EnvVarNames),
CtorFlags = init_decl_flags(public, per_instance, non_virtual,
overridable, modifiable, concrete),
Index: compiler/ml_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_util.m,v
retrieving revision 1.47
diff -u -b -r1.47 ml_util.m
--- compiler/ml_util.m 28 Jul 2006 05:08:12 -0000 1.47
+++ compiler/ml_util.m 28 Jul 2006 06:56:27 -0000
@@ -499,7 +499,7 @@
defn_contains_foreign_code(NativeTargetLang, Defn) :-
Defn = mlds_defn(_Name, _Context, _Flags, Body),
- Body = mlds_function(_, _, body_defined_here(FunctionBody), _),
+ Body = mlds_function(_, _, body_defined_here(FunctionBody), _, _),
statement_contains_statement(FunctionBody, Statement),
Statement = statement(Stmt, _),
(
@@ -511,7 +511,7 @@
defn_contains_outline_foreign_proc(ForeignLang, Defn) :-
Defn = mlds_defn(_Name, _Context, _Flags, Body),
- Body = mlds_function(_, _, body_defined_here(FunctionBody), _),
+ Body = mlds_function(_, _, body_defined_here(FunctionBody), _, _),
statement_contains_statement(FunctionBody, Statement),
Statement = statement(Stmt, _),
Stmt = atomic(outline_foreign_proc(ForeignLang, _, _, _)).
@@ -561,7 +561,7 @@
defn_body_contains_var(mlds_data(_Type, Initializer, _GC_TraceCode), Name) :-
initializer_contains_var(Initializer, Name).
defn_body_contains_var(mlds_function(_PredProcId, _Params, FunctionBody,
- _Attrs), Name) :-
+ _Attrs, _EnvVarNames), Name) :-
function_body_contains_var(FunctionBody, Name).
defn_body_contains_var(mlds_class(ClassDefn), Name) :-
ClassDefn = mlds_class_defn(_Kind, _Imports, _Inherits, _Implements,
Index: compiler/mlds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mlds.m,v
retrieving revision 1.135
diff -u -b -r1.135 mlds.m
--- compiler/mlds.m 28 Jul 2006 05:08:12 -0000 1.135
+++ compiler/mlds.m 28 Jul 2006 06:47:20 -0000
@@ -347,6 +347,7 @@
:- import_module map.
:- import_module maybe.
:- import_module pair.
+:- import_module set.
%-----------------------------------------------------------------------------%
@@ -570,7 +571,9 @@
% Mercury procedure, if any.
mlds_func_params, % The arguments & return types.
mlds_function_body, % The function body.
- list(mlds_attribute) % Attributes.
+ list(mlds_attribute), % Attributes.
+ set(string) % The set of environment variables
+ % referred to by the function body.
)
; mlds_class(
% Represents packages, classes, interfaces, structs, enums.
@@ -1476,6 +1479,14 @@
mlds_type
)
+ ; global_var_ref(
+ % A reference to the value of the C global variable with the
+ % given name. At least for now, the global variable's type
+ % must be MR_Word.
+
+ global_var_ref
+ )
+
% Variables.
% These may be local or they may come from some enclosing scope
% the variable name should be fully qualified.
@@ -1485,6 +1496,9 @@
mlds_type
).
+:- type global_var_ref
+ ---> env_var_ref(string).
+
%-----------------------------------------------------------------------------%
%
% Expressions
@@ -1704,7 +1718,7 @@
%-----------------------------------------------------------------------------%
-mlds_get_module_name(mlds(ModuleName, _, _, _, _, _)) = ModuleName.
+mlds_get_module_name(MLDS) = MLDS ^ name.
%-----------------------------------------------------------------------------%
Index: compiler/mlds_to_c.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mlds_to_c.m,v
retrieving revision 1.192
diff -u -b -r1.192 mlds_to_c.m
--- compiler/mlds_to_c.m 28 Jul 2006 05:08:12 -0000 1.192
+++ compiler/mlds_to_c.m 28 Jul 2006 07:37:04 -0000
@@ -108,6 +108,7 @@
:- import_module map.
:- import_module maybe.
:- import_module pair.
+:- import_module set.
:- import_module solutions.
:- import_module string.
:- import_module term.
@@ -259,8 +260,10 @@
InitPreds, FinalPreds),
ForeignCode = mlds_get_c_foreign_code(AllForeignCode),
+ EnvVarNameSet = mlds_get_env_var_names(Defns),
+ set.to_sorted_list(EnvVarNameSet, EnvVarNames),
mlds_output_src_start(Indent, ModuleName, ForeignCode,
- InitPreds, FinalPreds, !IO),
+ InitPreds, FinalPreds, EnvVarNames, !IO),
io.nl(!IO),
mlds_output_src_imports(Indent, Imports, !IO),
io.nl(!IO),
@@ -268,6 +271,8 @@
mlds_output_c_decls(Indent, ForeignCode, !IO),
io.nl(!IO),
+ list.foldl(mlds_output_env_var_decl, EnvVarNames, !IO),
+
% The public types have already been defined in the header file, and the
% public vars, consts, and functions have already been declared in the
% header file. In the source file, we need to have
@@ -290,8 +295,8 @@
PrivateNonTypeDefns),
list.filter(defn_is_type, Defns, _TypeDefns, NonTypeDefns),
list.filter(defn_is_function, NonTypeDefns, FuncDefns),
- list.filter(defn_is_type_ctor_info, NonTypeDefns,
- TypeCtorInfoDefns),
+ list.filter(defn_is_type_ctor_info, NonTypeDefns, TypeCtorInfoDefns),
+
MLDS_ModuleName = mercury_module_name_to_mlds(ModuleName),
mlds_output_defns(Indent, yes, MLDS_ModuleName, PrivateTypeDefns, !IO),
io.nl(!IO),
@@ -309,6 +314,25 @@
io.nl(!IO),
mlds_output_src_end(Indent, ModuleName, !IO).
+:- func mlds_get_env_var_names(mlds_defns) = set(string).
+
+mlds_get_env_var_names(Defns) = EnvVarNameSet :-
+ list.filter_map(mlds_get_env_var_names_from_defn, Defns, EnvVarNameSets),
+ EnvVarNameSet = set.union_list(EnvVarNameSets).
+
+:- pred mlds_get_env_var_names_from_defn(mlds_defn::in, set(string)::out)
+ is semidet.
+
+mlds_get_env_var_names_from_defn(Defn, EnvVarNameSet) :-
+ Defn = mlds_defn(_, _, _, mlds_function(_, _, _, _, EnvVarNameSet)).
+
+:- pred mlds_output_env_var_decl(string::in, io::di, io::uo) is det.
+
+mlds_output_env_var_decl(EnvVarName, !IO) :-
+ io.write_string("extern MR_Word ", !IO),
+ io.write_string(global_var_name(env_var_ref(EnvVarName)), !IO),
+ io.write_string(";\n", !IO).
+
:- pred mlds_output_hdr_start(indent::in, mercury_module_name::in,
io::di, io::uo) is det.
@@ -353,10 +377,10 @@
:- pred mlds_output_src_start(indent::in, mercury_module_name::in,
mlds_foreign_code::in, list(string)::in, list(string)::in,
- io::di, io::uo) is det.
+ list(string)::in, io::di, io::uo) is det.
mlds_output_src_start(Indent, ModuleName, ForeignCode, InitPreds, FinalPreds,
- !IO) :-
+ EnvVarNames, !IO) :-
mlds_output_auto_gen_comment(ModuleName, !IO),
mlds_indent(Indent, !IO),
io.write_string("/* :- module ", !IO),
@@ -367,7 +391,7 @@
mlds_output_src_bootstrap_defines(!IO),
io.nl(!IO),
mlds_output_init_and_final_comments(ModuleName, InitPreds, FinalPreds,
- !IO),
+ EnvVarNames, !IO),
mlds_output_src_import(Indent,
mercury_import(compiler_visible_interface,
@@ -388,10 +412,11 @@
% predicates to call from <module>_init.c.
%
:- pred mlds_output_init_and_final_comments(mercury_module_name::in,
- list(string)::in, list(string)::in, io::di, io::uo) is det.
+ list(string)::in, list(string)::in, list(string)::in, io::di, io::uo)
+ is det.
mlds_output_init_and_final_comments(ModuleName,
- UserInitPredCNames, UserFinalPredCNames, !IO) :-
+ UserInitPredCNames, UserFinalPredCNames, EnvVarNames, !IO) :-
io.write_string("/*\n", !IO),
% In profiling grades the module mercury__<modulename>__init predicate
% is responsible for calling MR_init_entry, so the INIT comment must be
@@ -416,10 +441,18 @@
output_init_name(ModuleName, !IO),
io.write_string("required_final\n", !IO)
),
+ list.foldl(mlds_output_env_var_init, EnvVarNames, !IO),
% We always write out ENDINIT so that mkinit doesn't scan the whole file.
io.write_string("ENDINIT\n", !IO),
io.write_string("*/\n\n", !IO).
+:- pred mlds_output_env_var_init(string::in, io::di, io::uo) is det.
+
+mlds_output_env_var_init(EnvVarName, !IO) :-
+ io.write_string("ENVVAR ", !IO),
+ io.write_string(EnvVarName, !IO),
+ io.nl(!IO).
+
% Output any #defines which are required to bootstrap in the hlc
% grade.
%
@@ -1204,7 +1237,7 @@
globals.io_lookup_bool_option(highlevel_data, HighLevelData, !IO),
(
HighLevelData = yes,
- DefnBody = mlds_function(_, Params, _, _)
+ DefnBody = mlds_function(_, Params, _, _, _)
->
Params = mlds_func_params(Arguments, _RetTypes),
ParamTypes = mlds_get_arg_types(Arguments),
@@ -1308,7 +1341,7 @@
!IO)
;
DefnBody = mlds_function(MaybePredProcId, Signature,
- _MaybeBody, _Attrs),
+ _MaybeBody, _Attrs, _EnvVarNames),
mlds_output_maybe(MaybePredProcId, mlds_output_pred_proc_id, !IO),
mlds_output_func_decl(Indent, Name, Context, Signature, !IO)
;
@@ -1328,7 +1361,8 @@
!IO)
;
DefnBody = mlds_function(MaybePredProcId, Signature,
- MaybeBody, _Attributes),
+ MaybeBody, _Attributes, _EnvVarNames),
+ % ZZZ
mlds_output_maybe(MaybePredProcId, mlds_output_pred_proc_id, !IO),
mlds_output_func(Indent, Name, Context, Signature, MaybeBody, !IO)
;
@@ -2360,7 +2394,7 @@
Name \= entity_type(_, _),
% Don't output "static" for functions that don't have a body.
% This can happen for Mercury procedures declared `:- external'
- DefnBody \= mlds_function(_, _, body_external, _)
+ DefnBody \= mlds_function(_, _, body_external, _, _)
->
io.write_string("static ", !IO)
;
@@ -3285,9 +3319,19 @@
mlds_output_lval(mem_ref(Rval, _Type), !IO) :-
io.write_string("*", !IO),
mlds_output_bracketed_rval(Rval, !IO).
+mlds_output_lval(global_var_ref(GobalVar), !IO) :-
+ io.write_string(global_var_name(GobalVar), !IO).
mlds_output_lval(var(VarName, _VarType), !IO) :-
mlds_output_var(VarName, !IO).
+:- func global_var_name(global_var_ref) = string.
+
+% The calls to env_var_is_acceptable_char in prog_io_goal.m ensure that
+% EnvVarName is acceptable as part of a C identifier.
+% The prefix must be identical to envvar_prefix in util/mkinit.c
+% and c_global_var_name in llds_out.m.
+global_var_name(env_var_ref(EnvVarName)) = "mercury_envvar_" ++ EnvVarName.
+
:- pred mlds_output_var(mlds_var::in, io::di, io::uo) is det.
mlds_output_var(VarName, !IO) :-
Index: compiler/mlds_to_gcc.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mlds_to_gcc.m,v
retrieving revision 1.119
diff -u -b -r1.119 mlds_to_gcc.m
--- compiler/mlds_to_gcc.m 28 Jul 2006 05:08:13 -0000 1.119
+++ compiler/mlds_to_gcc.m 28 Jul 2006 07:05:14 -0000
@@ -186,6 +186,7 @@
:- import_module map.
:- import_module maybe.
:- import_module pair.
+:- import_module set.
:- import_module solutions.
:- import_module string.
:- import_module term.
@@ -835,7 +836,9 @@
{ GlobalInfo = GlobalInfo0 ^ global_vars := GlobalVars }
;
{ DefnBody = mlds_function(_MaybePredProcId, Signature,
- FunctionBody, _Attributes) },
+ FunctionBody, _Attributes, EnvVarNames) },
+ { expect(set.empty(EnvVarNames), this_file,
+ "gen_defn_body: EnvVarNames") },
gen_func(Name, Context, Flags, Signature, FunctionBody,
GlobalInfo0, GlobalInfo)
;
@@ -855,7 +858,7 @@
build_local_data_defn(Name, Flags, Type,
Initializer, DefnInfo, GCC_Defn)
;
- { DefnBody = mlds_function(_, _, _, _) },
+ { DefnBody = mlds_function(_, _, _, _, _) },
% nested functions should get eliminated by ml_elim_nested,
% unless --gcc-nested-functions is enabled.
% XXX --gcc-nested-functions is not yet implemented
@@ -883,7 +886,7 @@
GCC_Defn),
add_field_decl_flags(Flags, GCC_Defn)
;
- { DefnBody = mlds_function(_, _, _, _) },
+ { DefnBody = mlds_function(_, _, _, _, _) },
{ unexpected(this_file, "function nested in type") }
;
{ DefnBody = mlds_class(_) },
@@ -3297,6 +3300,9 @@
build_rval(PointerRval, DefnInfo, PointerExpr),
gcc__build_pointer_deref(PointerExpr, Expr).
+build_lval(global_var_ref(_), _DefnInfo, _Expr) -->
+ { sorry(this_file, "build_lval: global_var_ref NYI") }.
+
build_lval(var(qual(ModuleName, QualKind, VarName), _VarType), DefnInfo,
Expr) -->
%
Index: compiler/mlds_to_il.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mlds_to_il.m,v
retrieving revision 1.164
diff -u -b -r1.164 mlds_to_il.m
--- compiler/mlds_to_il.m 28 Jul 2006 05:08:13 -0000 1.164
+++ compiler/mlds_to_il.m 28 Jul 2006 06:58:58 -0000
@@ -403,7 +403,7 @@
list.map(mlds_export_to_mlds_defn, AllExports, ExportDefns),
list.filter((pred(D::in) is semidet :-
- ( D = mlds_defn(_, _, _, mlds_function(_, _, _, _))
+ ( D = mlds_defn(_, _, _, mlds_function(_, _, _, _, _))
; D = mlds_defn(_, _, _, mlds_data(_, _, _))
)
), MLDS0 ^ defns ++ ExportDefns, MercuryCodeMembers, Others),
@@ -433,7 +433,7 @@
rename_maybe_statement(GC_TraceCode))
;
Entity0 = mlds_function(MaybePredProcId, Params, FunctionBody0,
- Attributes),
+ Attributes, EnvVarNames),
(
FunctionBody0 = body_defined_here(Stmt),
FunctionBody = body_defined_here(rename_statement(Stmt))
@@ -442,7 +442,7 @@
FunctionBody = body_external
),
Entity = mlds_function(MaybePredProcId, Params, FunctionBody,
- Attributes)
+ Attributes, EnvVarNames)
;
Entity0 = mlds_class(ClassDefn0),
ClassDefn0 = mlds_class_defn(Kind, Imports, Inherits, Implements,
@@ -581,6 +581,7 @@
= field(Tag, rename_rval(Address),
rename_field_id(FieldName), FieldType, PtrType).
rename_lval(mem_ref(Rval, Type)) = mem_ref(rename_rval(Rval), Type).
+rename_lval(global_var_ref(Ref)) = global_var_ref(Ref).
rename_lval(var(Var, Type)) = var(rename_var(Var, Type), Type).
:- func rename_field_id(mlds_field_id) = mlds_field_id.
@@ -633,7 +634,8 @@
Data = mlds_data(_Type, _Init, _GC),
sorry(this_file, "top level data definition!")
;
- Data = mlds_function(_MaybePredProcId, _Params, _MaybeStmts, _Attrs),
+ Data = mlds_function(_MaybePredProcId, _Params, _MaybeStmts, _Attrs,
+ _EnvVarNames),
sorry(this_file, "top level function definition!")
;
Data = mlds_class(ClassDefn),
@@ -714,8 +716,9 @@
Stmt = statement(block([], []), Context),
Attributes = [],
+ EnvVarNames = set.init,
Ctor = mlds_function(no, mlds_func_params([], []),
- body_defined_here(Stmt), Attributes),
+ body_defined_here(Stmt), Attributes, EnvVarNames),
CtorFlags = init_decl_flags(public, per_instance, non_virtual,
overridable, modifiable, concrete),
@@ -1047,7 +1050,9 @@
generate_method(_, IsCons, mlds_defn(Name, Context, Flags, Entity),
ClassMember, !Info) :-
Entity = mlds_function(_MaybePredProcId, Params, MaybeStatement,
- Attributes),
+ Attributes, EnvVarNames),
+ expect(set.empty(EnvVarNames), this_file,
+ "generate_method: EnvVarNames"),
il_info_get_module_name(!.Info, ModuleName),
@@ -1424,8 +1429,9 @@
), Context),
Attributes = [],
+ EnvVarNames = set.init,
DefnEntity = mlds_function(no, Params, body_defined_here(Statement),
- Attributes),
+ Attributes, EnvVarNames),
Flags = init_decl_flags(public, one_copy, non_virtual, overridable,
const, concrete),
@@ -2269,7 +2275,8 @@
load(lval(Lval), Instrs, !Info) :-
DataRep = !.Info ^ il_data_rep,
- ( Lval = var(Var, VarType),
+ (
+ Lval = var(Var, VarType),
mangle_mlds_var(Var, MangledVarStr),
( is_local(MangledVarStr, !.Info) ->
Instrs = instr_node(ldloc(name(MangledVarStr)))
@@ -2281,7 +2288,8 @@
FieldRef = make_static_fieldref(DataRep, Var, VarType),
Instrs = instr_node(ldsfld(FieldRef))
)
- ; Lval = field(_MaybeTag, Rval, FieldNum, FieldType, ClassType),
+ ;
+ Lval = field(_MaybeTag, Rval, FieldNum, FieldType, ClassType),
load(Rval, RvalLoadInstrs, !Info),
( FieldNum = offset(OffSet) ->
SimpleFieldType = mlds_type_to_ilds_simple_type(DataRep,
@@ -2301,13 +2309,17 @@
OffSetLoadInstrs,
instr_node(LoadInstruction)
])
- ; Lval = mem_ref(Rval, MLDS_Type),
+ ;
+ Lval = mem_ref(Rval, MLDS_Type),
SimpleType = mlds_type_to_ilds_simple_type(DataRep, MLDS_Type),
load(Rval, RvalLoadInstrs, !Info),
Instrs = tree_list([
RvalLoadInstrs,
instr_node(ldind(SimpleType))
])
+ ;
+ Lval = global_var_ref(_),
+ Instrs = throw_unimplemented("load lval mem_ref")
).
load(mkword(_Tag, _Rval), Instrs, !Info) :-
@@ -2363,7 +2375,8 @@
load(mem_addr(Lval), Instrs, !Info) :-
DataRep = !.Info ^ il_data_rep,
- ( Lval = var(Var, VarType),
+ (
+ Lval = var(Var, VarType),
mangle_mlds_var(Var, MangledVarStr),
( is_local(MangledVarStr, !.Info) ->
Instrs = instr_node(ldloca(name(MangledVarStr)))
@@ -2375,7 +2388,8 @@
FieldRef = make_static_fieldref(DataRep, Var, VarType),
Instrs = instr_node(ldsfld(FieldRef))
)
- ; Lval = field(_MaybeTag, Rval, FieldNum, FieldType, ClassType),
+ ;
+ Lval = field(_MaybeTag, Rval, FieldNum, FieldType, ClassType),
get_fieldref(DataRep, FieldNum, FieldType, ClassType,
FieldRef, CastClassInstrs),
load(Rval, RvalLoadInstrs, !Info),
@@ -2384,9 +2398,13 @@
CastClassInstrs,
instr_node(ldflda(FieldRef))
])
- ; Lval = mem_ref(_, _),
+ ;
+ Lval = mem_ref(_, _),
% XXX Implement this.
Instrs = throw_unimplemented("load mem_addr lval mem_ref")
+ ;
+ Lval = global_var_ref(_),
+ Instrs = throw_unimplemented("load mem_addr lval global_var_ref")
).
load(self(_), tree_list([instr_node(ldarg(index(0)))]), !Info).
@@ -2410,6 +2428,9 @@
% There's no swap instruction. Annoying, eh?
unexpected(this_file, "store into mem_ref").
+store(global_var_ref(_), _Instrs, !Info) :-
+ unexpected(this_file, "store into global_var_ref").
+
store(var(Var, VarType), Instrs, !Info) :-
DataRep = !.Info ^ il_data_rep,
mangle_mlds_var(Var, MangledVarStr),
@@ -3567,6 +3588,8 @@
rval_to_type(lval(var(_, Type)), Type).
rval_to_type(lval(field(_, _, _, Type, _)), Type).
rval_to_type(lval(mem_ref(_, Type)), Type).
+rval_to_type(lval(global_var_ref(_)), _) :-
+ sorry(this_file, "rval_to_type: global_var_ref").
rval_to_type(mkword(_, _), _) :-
unexpected(this_file, "rval_to_type: mkword").
rval_to_type(unop(Unop, _), Type) :-
Index: compiler/mlds_to_java.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mlds_to_java.m,v
retrieving revision 1.79
diff -u -b -r1.79 mlds_to_java.m
--- compiler/mlds_to_java.m 28 Jul 2006 05:08:13 -0000 1.79
+++ compiler/mlds_to_java.m 28 Jul 2006 07:00:35 -0000
@@ -232,6 +232,8 @@
;
unexpected(this_file, "mlds_lval_type: mem_ref of non-pointer")
).
+mlds_lval_type(global_var_ref(_)) = _ :-
+ sorry(this_file, "mlds_lval_type: global_var_ref NYI").
% Succeeds iff the Rval represents an integer constant.
%
@@ -587,7 +589,7 @@
list(mlds_code_addr)::in, list(mlds_code_addr)::out) is det.
method_ptrs_in_entity_defn(mlds_function(_MaybeID, _Params, Body,
- _Attributes), !CodeAddrs) :-
+ _Attributes, _EnvVars), !CodeAddrs) :-
(
Body = body_defined_here(Statement),
method_ptrs_in_statement(Statement, !CodeAddrs)
@@ -773,6 +775,7 @@
method_ptrs_in_lval(field(_MaybeTag, _Rval, _FieldId, _FieldType,
_PtrType), !CodeAddrs).
method_ptrs_in_lval(var(_Variable, _Type), !CodeAddrs).
+method_ptrs_in_lval(global_var_ref(_), !CodeAddrs).
%-----------------------------------------------------------------------------%
%
@@ -947,8 +950,9 @@
MethodParams = mlds_func_params(MethodArgs, MethodRets),
MethodMaybeID = no,
MethodAttribs = [],
+ MethodEnvVarNames = set.init,
MethodBody = mlds_function(MethodMaybeID, MethodParams,
- body_defined_here(Statements), MethodAttribs),
+ body_defined_here(Statements), MethodAttribs, MethodEnvVarNames),
MethodFlags = ml_gen_special_member_decl_flags,
MethodDefn = mlds_defn(MethodName, Context, MethodFlags, MethodBody).
@@ -1172,7 +1176,7 @@
output_defn(Indent, ModuleInfo, ModuleName, CtorData, Defn, !IO) :-
Defn = mlds_defn(Name, Context, Flags, DefnBody),
indent_line(Context, Indent, !IO),
- ( DefnBody = mlds_function(_, _, body_external, _) ->
+ ( DefnBody = mlds_function(_, _, body_external, _, _) ->
% This is just a function declaration, with no body.
% Java doesn't support separate declarations and definitions,
% so just output the declaration as a comment.
@@ -1200,7 +1204,9 @@
output_data_defn(ModuleInfo, Name, Type, Initializer, !IO).
output_defn_body(Indent, ModuleInfo, Name, CtorData, Context,
mlds_function(MaybePredProcId, Signature, MaybeBody,
- _Attributes), !IO) :-
+ _Attributes, EnvVarNames), !IO) :-
+ expect(set.empty(EnvVarNames), this_file,
+ "output_defn_body: EnvVarNames"),
output_maybe(MaybePredProcId, output_pred_proc_id, !IO),
output_func(Indent, ModuleInfo, Name, CtorData, Context, Signature,
MaybeBody, !IO).
@@ -2963,6 +2969,9 @@
output_lval(ModuleInfo, mem_ref(Rval, _Type), ModuleName, !IO) :-
output_bracketed_rval(ModuleInfo, Rval, ModuleName, !IO).
+output_lval(_ModuleInfo, global_var_ref(_), _ModuleName, !IO) :-
+ sorry(this_file, "output_lval: global_var_ref NYI").
+
output_lval(_, var(qual(ModName, QualKind, Name), _), CurrentModuleName,
!IO) :-
QualName = qual(ModName, QualKind, entity_data(var(Name))),
Index: compiler/mlds_to_managed.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mlds_to_managed.m,v
retrieving revision 1.31
diff -u -b -r1.31 mlds_to_managed.m
--- compiler/mlds_to_managed.m 28 Jul 2006 05:08:14 -0000 1.31
+++ compiler/mlds_to_managed.m 28 Jul 2006 07:03:41 -0000
@@ -76,6 +76,7 @@
:- import_module list.
:- import_module map.
:- import_module maybe.
+:- import_module set.
:- import_module string.
:- import_module term.
@@ -354,10 +355,12 @@
(
% XXX we ignore the attributes
Entity = mlds_function(_, Params, body_defined_here(Statement),
- _Attributes),
+ _Attributes, EnvVarNames),
has_foreign_languages(Statement, Langs),
list.member(Lang, Langs)
->
+ expect(set.empty(EnvVarNames), this_file,
+ "generate_method_code: EnvVarNames"),
get_il_data_rep(DataRep, !IO),
Params = mlds_func_params(Inputs, Outputs),
(
@@ -684,6 +687,8 @@
Lang = lang_csharp
),
write_rval(Lang, Rval, !IO).
+write_lval(_Lang, global_var_ref(_), !IO) :-
+ sorry(this_file, "write_lval: global_var_ref NYI").
write_lval(_Lang, var(Var, _VarType), !IO) :-
Var = qual(_, _, VarName),
write_mlds_var_name_for_parameter(VarName, !IO).
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing debian/patches
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/gator
cvs diff: Diffing extras/gator/generations
cvs diff: Diffing extras/gator/generations/1
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_glut
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/gears
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/solver_types
cvs diff: Diffing extras/solver_types/library
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/windows_installer_generator
cvs diff: Diffing extras/windows_installer_generator/sample
cvs diff: Diffing extras/windows_installer_generator/sample/images
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing extras/xml_stylesheets
cvs diff: Diffing java
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing mdbcomp
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing slice
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/par_conj
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/trailing
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
Index: util/mkinit.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/util/mkinit.c,v
retrieving revision 1.112
diff -u -b -r1.112 mkinit.c
--- util/mkinit.c 27 Jul 2006 05:03:54 -0000 1.112
+++ util/mkinit.c 28 Jul 2006 04:13:45 -0000
@@ -263,7 +263,7 @@
/*
** This should be kept in sync with the code of c_global_var_name
-** in llds_out.m.
+** in llds_out.m and global_var_name in mlds_to_c.m.
*/
const char *envvar_prefix = "mercury_envvar_";
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list