[m-rev.] diff: rename some function symbols
Zoltan Somogyi
zs at csse.unimelb.edu.au
Mon Jan 5 12:30:18 AEDT 2009
compiler/mlds.m:
Rename some function symbols to avoid one of them matching a keyword.
compiler/ml_closure_gen.m:
compiler/ml_code_gen.m:
compiler/ml_code_util.m:
compiler/ml_elim_nested.m:
compiler/ml_string_switch.m:
compiler/ml_type_gen.m:
compiler/ml_unify_gen.m:
compiler/ml_util.m:
compiler/mlds_to_c.m:
compiler/mlds_to_gcc.m:
compiler/mlds_to_il.m:
compiler/mlds_to_java.m:
compiler/rtti_to_mlds.m:
Conform to the change.
Zoltan.
cvs diff: Diffing .
Index: ml_closure_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_closure_gen.m,v
retrieving revision 1.56
diff -u -b -r1.56 ml_closure_gen.m
--- ml_closure_gen.m 11 Feb 2008 21:26:00 -0000 1.56
+++ ml_closure_gen.m 2 Jan 2009 15:36:47 -0000
@@ -209,7 +209,7 @@
ml_gen_info_new_const(LayoutSeqNum, !Info),
ml_format_static_const_name(!.Info, "closure_layout", LayoutSeqNum, Name),
- Access = local,
+ Access = acc_local,
Initializer = init_array(Inits),
% XXX There's no way in C to properly represent this type,
% since it is a struct that ends with a variable-length array.
@@ -424,7 +424,7 @@
convert_to_local(mlds_defn(Name, Context, Flags0, Body)) =
mlds_defn(Name, Context, Flags, Body) :-
- Flags = set_access(Flags0, local).
+ Flags = set_access(Flags0, acc_local).
:- pred ml_stack_layout_construct_tvar_vector(module_info::in,
mlds_var_name::in, prog_context::in, map(tvar, set(layout_locn))::in,
@@ -437,7 +437,7 @@
MLDS_Rval = const(mlconst_null(ArrayType)),
Defns = []
;
- Access = local,
+ Access = acc_local,
ml_stack_layout_construct_tvar_rvals(TVarLocnMap, Vector,
_VectorTypes),
Initializer = init_array(Vector),
@@ -977,7 +977,7 @@
Func0),
Func0 = mlds_defn(Name, Ctxt, DeclFlags0, Defn),
DeclFlags1 = set_per_instance(DeclFlags0, one_copy),
- DeclFlags = set_access(DeclFlags1, private),
+ DeclFlags = set_access(DeclFlags1, acc_private),
Func = mlds_defn(Name, Ctxt, DeclFlags, Defn).
:- func ml_gen_wrapper_head_var_names(int, int) = list(mlds_var_name).
Index: ml_code_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_code_gen.m,v
retrieving revision 1.212
diff -u -b -r1.212 ml_code_gen.m
--- ml_code_gen.m 23 Dec 2008 01:37:36 -0000 1.212
+++ ml_code_gen.m 2 Jan 2009 15:37:00 -0000
@@ -1284,7 +1284,7 @@
:- func tabling_data_decl_flags(constness) = mlds_decl_flags.
tabling_data_decl_flags(Constness) = MLDS_DeclFlags :-
- Access = private,
+ Access = acc_private,
PerInstance = one_copy,
Virtuality = non_virtual,
Finality = final,
@@ -1305,9 +1305,9 @@
ml_gen_proc_decl_flags(ModuleInfo, PredId, ProcId) = DeclFlags :-
module_info_pred_info(ModuleInfo, PredId, PredInfo),
( procedure_is_exported(ModuleInfo, PredInfo, ProcId) ->
- Access = public
+ Access = acc_public
;
- Access = private
+ Access = acc_private
),
PerInstance = one_copy,
Virtuality = non_virtual,
Index: ml_code_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_code_util.m,v
retrieving revision 1.134
diff -u -b -r1.134 ml_code_util.m
--- ml_code_util.m 11 Feb 2008 21:26:01 -0000 1.134
+++ ml_code_util.m 2 Jan 2009 15:37:34 -0000
@@ -956,7 +956,7 @@
:- func ml_gen_label_func_decl_flags = mlds_decl_flags.
ml_gen_label_func_decl_flags = DeclFlags :-
- Access = local,
+ Access = acc_local,
PerInstance = per_instance,
Virtuality = non_virtual,
Finality = overridable,
@@ -1530,7 +1530,7 @@
MLDS_Defn = mlds_defn(Name, MLDS_Context, DeclFlags, Defn).
ml_gen_public_field_decl_flags = DeclFlags :-
- Access = public,
+ Access = acc_public,
PerInstance = per_instance,
Virtuality = non_virtual,
Finality = overridable,
@@ -1540,7 +1540,7 @@
Virtuality, Finality, Constness, Abstractness).
ml_gen_local_var_decl_flags = DeclFlags :-
- Access = local,
+ Access = acc_local,
PerInstance = per_instance,
Virtuality = non_virtual,
Finality = overridable,
@@ -1552,7 +1552,7 @@
ml_static_const_decl_flags = DeclFlags :-
% Note that rtti_decl_flags, in rtti_to_mlds.m,
% must be the same as this apart from the access.
- Access = local,
+ Access = acc_local,
PerInstance = one_copy,
Virtuality = non_virtual,
Finality = final,
Index: ml_elim_nested.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_elim_nested.m,v
retrieving revision 1.98
diff -u -b -r1.98 ml_elim_nested.m
--- ml_elim_nested.m 8 Sep 2008 03:39:03 -0000 1.98
+++ ml_elim_nested.m 2 Jan 2009 15:38:26 -0000
@@ -1028,7 +1028,7 @@
:- func ml_gen_gc_trace_func_decl_flags = mlds_decl_flags.
ml_gen_gc_trace_func_decl_flags = MLDS_DeclFlags :-
- Access = private,
+ Access = acc_private,
PerInstance = one_copy,
Virtuality = non_virtual,
Finality = overridable,
@@ -1066,8 +1066,8 @@
convert_local_to_field(mlds_defn(Name, Context, Flags0, Body)) =
mlds_defn(Name, Context, Flags, Body) :-
- ( access(Flags0) = local ->
- Flags = set_access(Flags0, public)
+ ( access(Flags0) = acc_local ->
+ Flags = set_access(Flags0, acc_public)
;
Flags = Flags0
).
@@ -1079,8 +1079,8 @@
convert_local_to_global(mlds_defn(Name, Context, Flags0, Body)) =
mlds_defn(Name, Context, Flags, Body) :-
- ( access(Flags0) = local ->
- Flags = set_access(Flags0, private)
+ ( access(Flags0) = acc_local ->
+ Flags = set_access(Flags0, acc_private)
;
Flags = Flags0
).
@@ -1210,7 +1210,7 @@
:- func env_type_decl_flags = mlds_decl_flags.
env_type_decl_flags = MLDS_DeclFlags :-
- Access = private,
+ Access = acc_private,
PerInstance = one_copy,
Virtuality = non_virtual,
Finality = overridable,
@@ -1563,7 +1563,7 @@
Action = !.Info ^ action,
(
Action = hoist_nested_funcs,
- Flags1 = set_access(Flags0, private),
+ Flags1 = set_access(Flags0, acc_private),
Flags = set_per_instance(Flags1, one_copy)
;
Action = chain_gc_stack_frames,
Index: ml_string_switch.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_string_switch.m,v
retrieving revision 1.36
diff -u -b -r1.36 ml_string_switch.m
--- ml_string_switch.m 21 Jan 2008 00:32:52 -0000 1.36
+++ ml_string_switch.m 2 Jan 2009 15:39:06 -0000
@@ -140,7 +140,7 @@
NextSlotsName),
NextSlotsType = mlds_array_type(SlotVarType),
NextSlotsDefn = ml_gen_static_const_defn(NextSlotsName,
- NextSlotsType, local, init_array(NextSlots), Context),
+ NextSlotsType, acc_local, init_array(NextSlots), Context),
ml_gen_var_lval(!.Info, NextSlotsName, NextSlotsType, NextSlotsLval),
ml_gen_info_new_const(StringTableSeq, !Info),
@@ -148,7 +148,7 @@
StringTableName),
StringTableType = mlds_array_type(StringVarType),
StringTableDefn = ml_gen_static_const_defn(StringTableName,
- StringTableType, local, init_array(Strings), Context),
+ StringTableType, acc_local, init_array(Strings), Context),
ml_gen_var_lval(!.Info, StringTableName, StringTableType,
StringTableLval),
Index: ml_type_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_type_gen.m,v
retrieving revision 1.75
diff -u -b -r1.75 ml_type_gen.m
--- ml_type_gen.m 11 Feb 2008 21:26:02 -0000 1.75
+++ ml_type_gen.m 2 Jan 2009 15:39:53 -0000
@@ -629,7 +629,7 @@
UnqualCtorName, CtorArity),
MLDS_ReservedObjDefn = ml_gen_static_const_defn(
MLDS_ReservedObjName, SecondaryTagClassId,
- public, no_initializer, Context),
+ acc_public, no_initializer, Context),
MLDS_Members = [MLDS_ReservedObjDefn | MLDS_Members0]
;
% For reserved numeric addresses, we don't need to generate
@@ -835,7 +835,7 @@
EnvVarNames = set.init,
Ctor = mlds_function(no, mlds_func_params(Args, ReturnValues),
body_defined_here(Stmt), Attributes, EnvVarNames),
- CtorFlags = init_decl_flags(public, per_instance, non_virtual,
+ CtorFlags = init_decl_flags(acc_public, per_instance, non_virtual,
overridable, modifiable, concrete),
% Note that the name of constructor is determined by the backend
@@ -1014,7 +1014,7 @@
ml_gen_type_decl_flags = MLDS_DeclFlags :-
% XXX are these right?
- Access = public,
+ Access = acc_public,
PerInstance = one_copy,
Virtuality = non_virtual,
Finality = overridable,
@@ -1024,7 +1024,7 @@
Virtuality, Finality, Constness, Abstractness).
ml_gen_member_decl_flags = MLDS_DeclFlags :-
- Access = public,
+ Access = acc_public,
PerInstance = per_instance,
Virtuality = non_virtual,
Finality = overridable,
@@ -1034,7 +1034,7 @@
Virtuality, Finality, Constness, Abstractness).
ml_gen_enum_constant_decl_flags = MLDS_DeclFlags :-
- Access = public,
+ Access = acc_public,
PerInstance = one_copy,
Virtuality = non_virtual,
Finality = final,
@@ -1044,7 +1044,7 @@
Virtuality, Finality, Constness, Abstractness).
ml_gen_special_member_decl_flags = MLDS_DeclFlags :-
- Access = public,
+ Access = acc_public,
PerInstance = per_instance,
Virtuality = non_virtual,
Finality = final,
Index: ml_unify_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_unify_gen.m,v
retrieving revision 1.125
diff -u -b -r1.125 ml_unify_gen.m
--- ml_unify_gen.m 8 Sep 2008 03:39:04 -0000 1.125
+++ ml_unify_gen.m 4 Jan 2009 01:21:02 -0000
@@ -43,6 +43,7 @@
cons_tag::out) is det.
% ml_gen_tag_test(Var, ConsId, Defns, Statements, Expression):
+ %
% Generate code to perform a tag test.
%
% The test checks whether Var has the functor specified by ConsId.
@@ -118,18 +119,22 @@
%-----------------------------------------------------------------------------%
-ml_gen_unification(Unification, CodeModel, Context, [], Statements, !Info) :-
+ml_gen_unification(Unification, CodeModel, Context, Decls, Statements,
+ !Info) :-
+ (
Unification = assign(TargetVar, SourceVar),
expect(unify(CodeModel, model_det), this_file,
"ml_code_gen: assign not det"),
- (
- % Skip dummy argument types, since they will not have been declared.
ml_variable_type(!.Info, TargetVar, Type),
ml_gen_info_get_module_info(!.Info, ModuleInfo),
- check_dummy_type(ModuleInfo, Type) = is_dummy_type
- ->
+ IsDummyType = check_dummy_type(ModuleInfo, Type),
+ (
+ % Skip dummy argument types, since they will not have been
+ % declared.
+ IsDummyType = is_dummy_type,
Statements = []
;
+ IsDummyType = is_not_dummy_type,
ml_gen_var(!.Info, TargetVar, TargetLval),
ml_gen_var(!.Info, SourceVar, SourceLval),
Statement = ml_gen_assign(TargetLval, lval(SourceLval), Context),
@@ -139,18 +144,18 @@
% If the source variable is a constant, so is the target after
% this assignment.
%
- % The mark_static_terms assumes that if SourceVar is a constant term,
- % then after this assignment unification TargetVar is a constant term
- % also. Therefore later constant terms may contain TargetVar among
- % their arguments. If we didn't copy the constant info here, the
- % construction of the later constant could cause a code generator
- % abort.
+ % The mark_static_terms assumes that if SourceVar is a constant
+ % term, then after this assignment unification TargetVar is a
+ % constant term also. Therefore later constant terms may contain
+ % TargetVar among their arguments. If we didn't copy the constant
+ % info here, the construction of the later constant could cause
+ % a code generator abort.
ml_gen_info_set_const_var_name(TargetVar, Name, !Info)
;
true
- ).
-
-ml_gen_unification(Unification, CodeModel, Context, [], [Statement], !Info) :-
+ ),
+ Decls = []
+ ;
Unification = simple_test(Var1, Var2),
expect(unify(CodeModel, model_semi), this_file,
"ml_code_gen: simple_test not semidet"),
@@ -165,10 +170,10 @@
ml_gen_var(!.Info, Var1, Var1Lval),
ml_gen_var(!.Info, Var2, Var2Lval),
Test = binop(EqualityOp, lval(Var1Lval), lval(Var2Lval)),
- ml_gen_set_success(!.Info, Test, Context, Statement).
-
-ml_gen_unification(Unification, CodeModel, Context, Decls, Statements,
- !Info) :-
+ ml_gen_set_success(!.Info, Test, Context, Statement),
+ Statements = [Statement],
+ Decls = []
+ ;
Unification = construct(Var, ConsId, Args, ArgModes, HowToConstruct,
_CellIsUnique, SubInfo),
expect(unify(CodeModel, model_det), this_file,
@@ -188,11 +193,10 @@
"ml_code_gen: term size profiling not yet supported")
),
ml_gen_construct(Var, ConsId, Args, ArgModes, TakeAddr, HowToConstruct,
- Context, Decls, Statements, !Info).
-
-ml_gen_unification(Unification, CodeModel, Context, Decls, Statements,
- !Info) :-
- Unification = deconstruct(Var, ConsId, Args, ArgModes, CanFail, CanCGC),
+ Context, Decls, Statements, !Info)
+ ;
+ Unification = deconstruct(Var, ConsId, Args, ArgModes, CanFail,
+ CanCGC),
(
CanFail = can_fail,
ExpectedCodeModel = model_semi,
@@ -206,14 +210,14 @@
),
(
% Note that we can deallocate a cell even if the unification fails,
- % it is the responsibility of the structure reuse phase to ensure that
- % this is safe.
+ % it is the responsibility of the structure reuse phase to ensure
+ % that this is safe.
CanCGC = can_cgc,
ml_gen_var(!.Info, Var, VarLval),
- % XXX avoid strip_tag when we know what tag it will have
+ % XXX Avoid strip_tag when we know what tag it will have.
Delete = delete_object(unop(std_unop(strip_tag), lval(VarLval))),
Stmt = ml_stmt_atomic(Delete),
- CGC_Statements = [statement(Stmt, mlds_make_context(Context)) ]
+ CGC_Statements = [statement(Stmt, mlds_make_context(Context))]
;
CanCGC = cannot_cgc,
CGC_Statements = []
@@ -224,13 +228,13 @@
% determinism field in the goal_info is allowed to be a conservative
% approximation, so we need to handle the case were CodeModel is less
% precise than ExpectedCodeModel.
- %
ml_gen_wrap_goal(CodeModel, ExpectedCodeModel, Context,
- Statements0, Statements, !Info).
-
-ml_gen_unification(complicated_unify(_, _, _), _, _, [], [], !Info) :-
+ Statements0, Statements, !Info)
+ ;
+ Unification = complicated_unify(_, _, _),
% Simplify.m should have converted these into procedure calls.
- unexpected(this_file, "ml_code_gen: complicated unify").
+ unexpected(this_file, "ml_code_gen: complicated unify")
+ ).
% ml_gen_construct generates code for a construction unification.
%
@@ -346,7 +350,8 @@
static_cons::in, prog_context::in, mlds_defns::out, mlds_rval::out,
ml_gen_info::in, ml_gen_info::out) is det.
-ml_gen_static_const_arg_2(Tag, VarType, Var, StaticCons, Context, Defns, Rval, !Info) :-
+ml_gen_static_const_arg_2(Tag, VarType, Var, StaticCons, Context, Defns, Rval,
+ !Info) :-
StaticCons = static_cons(ConsId, ArgVars, StaticArgs),
(
% Types for which some other constructor has a reserved_address
@@ -750,7 +755,7 @@
Initializer = init_struct(ConstType, ArgInits)
),
ConstDefn = ml_gen_static_const_defn(ConstName, ConstType,
- local, Initializer, Context),
+ acc_local, Initializer, Context),
% Assign the address of the local static constant to the variable.
ml_gen_static_const_addr(!.Info, Var, ConstType, ConstAddrRval),
@@ -792,7 +797,8 @@
ml_gen_var(!.Info, Var, Var1Lval),
ml_gen_var(!.Info, ReuseVar, Var2Lval),
- list.filter((pred(ReuseTag::in) is semidet :-
+ list.filter(
+ (pred(ReuseTag::in) is semidet :-
ReuseTag \= PrimaryTag
), ReusePrimaryTags, DifferentTags),
(
@@ -1167,7 +1173,7 @@
[i(PredIdNum), i(ProcIdNum), i(SequenceNum)]), no),
Initializer = init_obj(Rval),
ConstDefn = ml_gen_static_const_defn(ConstName, Type,
- local, Initializer, Context),
+ acc_local, Initializer, Context),
ConstDefns = [ConstDefn],
% Return as the boxed rval the address of that constant,
@@ -1346,6 +1352,10 @@
prog_context::in, statements::out, ml_gen_info::in, ml_gen_info::out)
is det.
+ml_gen_extra_arg_assign([_ | _], [], _, _, _, _, _, _, !Info) :-
+ unexpected(this_file, "ml_gen_extra_arg_assign: length mismatch").
+ml_gen_extra_arg_assign([], [_ | _], _, _, _, _, _, _, !Info) :-
+ unexpected(this_file, "ml_gen_extra_arg_assign: length mismatch").
ml_gen_extra_arg_assign([], [], _, _, _, _, _, [], !Info).
ml_gen_extra_arg_assign([ExtraRval | ExtraRvals], [ExtraType | ExtraTypes],
VarType, VarLval, Offset, ConsIdTag, Context,
@@ -1370,11 +1380,6 @@
ml_gen_extra_arg_assign(ExtraRvals, ExtraTypes, VarType, VarLval,
Offset + 1, ConsIdTag, Context, Statements, !Info).
-ml_gen_extra_arg_assign([_ | _], [], _, _, _, _, _, _, !Info) :-
- unexpected(this_file, "ml_gen_extra_arg_assign: length mismatch").
-ml_gen_extra_arg_assign([], [_ | _], _, _, _, _, _, _, !Info) :-
- unexpected(this_file, "ml_gen_extra_arg_assign: length mismatch").
-
%-----------------------------------------------------------------------------%
% Generate a deterministic deconstruction. In a deterministic
@@ -1745,8 +1750,8 @@
%-----------------------------------------------------------------------------%
% Generate a semidet deconstruction. A semidet deconstruction unification
- % is tag test followed by a deterministic deconstruction (which is executed
- % only if the tag test succeeds).
+ % is a tag test, followed by a deterministic deconstruction which is
+ % executed only if the tag test succeeds.
%
% semidet (can_fail) deconstruction:
% <succeeded = (X => f(A1, A2, ...))>
@@ -2028,7 +2033,6 @@
this_file = "ml_unify_gen.m".
-:- end_module ml_unify_gen.
-
%-----------------------------------------------------------------------------%
+:- end_module ml_unify_gen.
%-----------------------------------------------------------------------------%
Index: ml_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_util.m,v
retrieving revision 1.60
diff -u -b -r1.60 ml_util.m
--- ml_util.m 11 Sep 2007 03:12:30 -0000 1.60
+++ ml_util.m 2 Jan 2009 15:40:34 -0000
@@ -535,7 +535,7 @@
defn_is_public(Defn) :-
Defn = mlds_defn(_Name, _Context, Flags, _Body),
- access(Flags) = public.
+ access(Flags) = acc_public.
% defns_contains_var:
% defn_contains_var:
Index: mlds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mlds.m,v
retrieving revision 1.165
diff -u -b -r1.165 mlds.m
--- mlds.m 8 Sep 2008 03:39:04 -0000 1.165
+++ mlds.m 2 Jan 2009 15:41:28 -0000
@@ -40,7 +40,6 @@
% MLDS code in the first place or run some extra simplification passes over
% the MLDS code before invoking the MLDS->target compiler.
%
-%
%-----------------------------------------------------------------------------%
%
% Mapping Mercury names to MLDS names
@@ -853,16 +852,21 @@
% The following used for class members (this includes globals,
% which are actually members of the top-level package)
- ---> public % Accessible to anyone.
- ; protected % Only accessible to the class and to derived classes.
- ; private % Only accessible to the class.
- ; default % Java "default" access or .NET assembly access:
+ ---> acc_public
+ % Accessible to anyone.
+ ; acc_protected
+ % Only accessible to the class and to derived classes.
+ ; acc_private
+ % Only accessible to the class.
+ ; acc_default
+ % Java "default" access or .NET assembly access:
% accessible to anything defined in the same package.
% The following is used for entities defined in a block/2 statement,
% i.e. local variables and nested functions.
- ; local. % Only accessible within the block in which the entity
+ ; acc_local.
+ % Only accessible within the block in which the entity
% (variable or nested function) is defined.
:- type per_instance
@@ -983,7 +987,6 @@
% least once -- in that case, the compiler can generate a
% `do...while' loop rather than a `while...' loop.
-
% Selection (see also computed_goto).
; ml_stmt_if_then_else(mlds_rval, statement, maybe(statement))
@@ -2041,11 +2044,11 @@
:- func access_bits(access) = int.
:- mode access_bits(in) = out is det.
:- mode access_bits(out) = in is semidet.
-access_bits(public) = 0x00.
-access_bits(private) = 0x01.
-access_bits(protected) = 0x02.
-access_bits(default) = 0x03.
-access_bits(local) = 0x04.
+access_bits(acc_public) = 0x00.
+access_bits(acc_private) = 0x01.
+access_bits(acc_protected) = 0x02.
+access_bits(acc_default) = 0x03.
+access_bits(acc_local) = 0x04.
% 0x5 - 0x7 reserved
:- func access_mask = int.
Index: mlds_to_c.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mlds_to_c.m,v
retrieving revision 1.231
diff -u -b -r1.231 mlds_to_c.m
--- mlds_to_c.m 8 Sep 2008 03:39:04 -0000 1.231
+++ mlds_to_c.m 2 Jan 2009 15:43:04 -0000
@@ -2502,15 +2502,15 @@
:- pred mlds_output_access_comment_2(access::in, io::di, io::uo) is det.
-mlds_output_access_comment_2(public, !IO) :-
+mlds_output_access_comment_2(acc_public, !IO) :-
io.write_string("/* public: */ ", !IO).
-mlds_output_access_comment_2(private, !IO) :-
+mlds_output_access_comment_2(acc_private, !IO) :-
io.write_string("/* private: */ ", !IO).
-mlds_output_access_comment_2(protected, !IO) :-
+mlds_output_access_comment_2(acc_protected, !IO) :-
io.write_string("/* protected: */ ", !IO).
-mlds_output_access_comment_2(default, !IO) :-
+mlds_output_access_comment_2(acc_default, !IO) :-
io.write_string("/* default access */ ", !IO).
-mlds_output_access_comment_2(local, !IO) :-
+mlds_output_access_comment_2(acc_local, !IO) :-
io.write_string("/* local: */ ", !IO).
:- pred mlds_output_per_instance_comment(per_instance::in, io::di, io::uo)
@@ -2540,9 +2540,9 @@
!IO) :-
(
(
- Access = private
+ Access = acc_private
;
- Access = local,
+ Access = acc_local,
PerInstance = one_copy
),
Name \= entity_type(_, _),
@@ -2561,7 +2561,7 @@
% with "auto".
DeclOrDefn = forward_decl,
Name = entity_function(_, _, _, _),
- Access = local
+ Access = acc_local
->
io.write_string("auto ", !IO)
;
Index: mlds_to_gcc.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mlds_to_gcc.m,v
retrieving revision 1.140
diff -u -b -r1.140 mlds_to_gcc.m
--- mlds_to_gcc.m 8 Sep 2008 03:39:04 -0000 1.140
+++ mlds_to_gcc.m 2 Jan 2009 16:08:30 -0000
@@ -1,4 +1,6 @@
%-----------------------------------------------------------------------------%
+% vim: ft=mercury ts=4 sw=4 et
+%-----------------------------------------------------------------------------%
% Copyright (C) 1999-2008 The University of Melbourne.
% This file may only be copied under the terms of the GNU General
% Public License - see the file COPYING in the Mercury distribution.
@@ -372,7 +374,7 @@
:- func make_public(mlds_defn) = mlds_defn.
make_public(mlds_defn(Name, Context, Flags0, Defn)) =
mlds_defn(Name, Context, Flags, Defn) :-
- Flags = mlds__set_access(Flags0, public).
+ Flags = mlds__set_access(Flags0, acc_public).
%-----------------------------------------------------------------------------%
@@ -911,17 +913,17 @@
:- pred add_var_access_flag(access, gcc__var_decl, io__state, io__state).
:- mode add_var_access_flag(in, in, di, uo) is det.
-add_var_access_flag(public, GCC_Defn) -->
+add_var_access_flag(acc_public, GCC_Defn) -->
gcc__set_var_decl_public(GCC_Defn).
-add_var_access_flag(private, _GCC_Defn) -->
+add_var_access_flag(acc_private, _GCC_Defn) -->
% this should only be used for global variables,
% where it is the default
[].
-add_var_access_flag(protected, _GCC_Defn) -->
+add_var_access_flag(acc_protected, _GCC_Defn) -->
{ sorry(this_file, "`protected' access") }.
-add_var_access_flag(default, _GCC_Defn) -->
+add_var_access_flag(acc_default, _GCC_Defn) -->
{ sorry(this_file, "`default' access") }.
-add_var_access_flag(local, _GCC_Defn) -->
+add_var_access_flag(acc_local, _GCC_Defn) -->
% this should only be used for local variables,
% where it is the default
[].
@@ -979,27 +981,27 @@
:- mode add_field_decl_flags(in, in, di, uo) is det.
add_field_decl_flags(Flags, GCC_Defn) -->
- add_field_access_flag( access(Flags), GCC_Defn),
- add_field_per_instance_flag( per_instance(Flags), GCC_Defn),
- add_field_virtuality_flag( virtuality(Flags), GCC_Defn),
- add_field_finality_flag( finality(Flags), GCC_Defn),
- add_field_constness_flag( constness(Flags), GCC_Defn),
- add_field_abstractness_flag( abstractness(Flags), GCC_Defn).
+ add_field_access_flag(access(Flags), GCC_Defn),
+ add_field_per_instance_flag(per_instance(Flags), GCC_Defn),
+ add_field_virtuality_flag(virtuality(Flags), GCC_Defn),
+ add_field_finality_flag(finality(Flags), GCC_Defn),
+ add_field_constness_flag(constness(Flags), GCC_Defn),
+ add_field_abstractness_flag(abstractness(Flags), GCC_Defn).
:- pred add_field_access_flag(access, gcc__field_decl,
io__state, io__state).
:- mode add_field_access_flag(in, in, di, uo) is det.
-add_field_access_flag(public, _GCC_Defn) -->
+add_field_access_flag(acc_public, _GCC_Defn) -->
% this is the default
[].
-add_field_access_flag(private, _GCC_Defn) -->
+add_field_access_flag(acc_private, _GCC_Defn) -->
{ sorry(this_file, "`private' field") }.
-add_field_access_flag(protected, _GCC_Defn) -->
+add_field_access_flag(acc_protected, _GCC_Defn) -->
{ sorry(this_file, "`protected' field") }.
-add_field_access_flag(default, _GCC_Defn) -->
+add_field_access_flag(acc_default, _GCC_Defn) -->
{ sorry(this_file, "`default' field") }.
-add_field_access_flag(local, _GCC_Defn) -->
+add_field_access_flag(acc_local, _GCC_Defn) -->
{ sorry(this_file, "`local' field") }.
:- pred add_field_per_instance_flag(mlds__per_instance, gcc__field_decl,
@@ -1073,16 +1075,16 @@
io__state, io__state).
:- mode add_func_access_flag(in, in, di, uo) is det.
-add_func_access_flag(public, GCC_Defn) -->
+add_func_access_flag(acc_public, GCC_Defn) -->
gcc__set_func_decl_public(GCC_Defn).
-add_func_access_flag(private, _GCC_Defn) -->
+add_func_access_flag(acc_private, _GCC_Defn) -->
% this is the default
[].
-add_func_access_flag(protected, _GCC_Defn) -->
+add_func_access_flag(acc_protected, _GCC_Defn) -->
{ sorry(this_file, "`protected' access") }.
-add_func_access_flag(default, _GCC_Defn) -->
+add_func_access_flag(acc_default, _GCC_Defn) -->
{ sorry(this_file, "`default' access") }.
-add_func_access_flag(local, _GCC_Defn) -->
+add_func_access_flag(acc_local, _GCC_Defn) -->
% nested functions are not supported
{ sorry(this_file, "`local' access") }.
Index: mlds_to_il.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mlds_to_il.m,v
retrieving revision 1.198
diff -u -b -r1.198 mlds_to_il.m
--- mlds_to_il.m 8 Sep 2008 03:39:04 -0000 1.198
+++ mlds_to_il.m 2 Jan 2009 15:45:02 -0000
@@ -675,7 +675,7 @@
% is created by al.exe. This occurs for nondet environment classes
% in the mercury std library.
( ClassName = structured_name(assembly("mercury"), _, _) ->
- Flags = set_access(Flags0, public)
+ Flags = set_access(Flags0, acc_public)
;
Flags = Flags0
),
@@ -724,7 +724,7 @@
EnvVarNames = set.init,
Ctor = mlds_function(no, mlds_func_params([], []),
body_defined_here(Stmt), Attributes, EnvVarNames),
- CtorFlags = init_decl_flags(public, per_instance, non_virtual,
+ CtorFlags = init_decl_flags(acc_public, per_instance, non_virtual,
overridable, modifiable, concrete),
CtorDefn = mlds_defn(entity_export(".ctor"), Context, CtorFlags, Ctor),
@@ -782,22 +782,22 @@
list.condense([Access, decl_flags_to_classattrs_2(Flags)]) :-
AccessFlag = access(Flags),
(
- AccessFlag = public,
+ AccessFlag = acc_public,
Access = [public]
;
- AccessFlag = protected,
+ AccessFlag = acc_protected,
unexpected(this_file,
"decl_flags_to_classattrs: protected access flag")
;
- AccessFlag = private,
+ AccessFlag = acc_private,
Access = [private]
;
- AccessFlag = default,
+ AccessFlag = acc_default,
% To make members of the private class accessible to other types
% in the assembly, set their access to be default or public.
Access = [private]
;
- AccessFlag = local,
+ AccessFlag = acc_local,
unexpected(this_file,
"decl_flags_to_classattrs: local access flag")
).
@@ -809,19 +809,19 @@
= list.condense([Access, decl_flags_to_classattrs_2(Flags)]) :-
AccessFlag = access(Flags),
(
- AccessFlag = public,
+ AccessFlag = acc_public,
Access = [nestedpublic]
;
- AccessFlag = protected,
+ AccessFlag = acc_protected,
Access = [nestedfamily]
;
- AccessFlag = private,
+ AccessFlag = acc_private,
Access = [nestedprivate]
;
- AccessFlag = default,
+ AccessFlag = acc_default,
Access = [nestedassembly]
;
- AccessFlag = local,
+ AccessFlag = acc_local,
unexpected(this_file,
"decl_flags_to_classattrs: local access flag")
).
@@ -853,19 +853,19 @@
Finality, Abstractness]) :-
AccessFlag = access(Flags),
(
- AccessFlag = public,
+ AccessFlag = acc_public,
Access = [public]
;
- AccessFlag = protected,
+ AccessFlag = acc_protected,
Access = [family]
;
- AccessFlag = private,
+ AccessFlag = acc_private,
Access = [private]
;
- AccessFlag = default,
+ AccessFlag = acc_default,
Access = [assembly]
;
- AccessFlag = local,
+ AccessFlag = acc_local,
unexpected(this_file,
"decl_flags_to_methattrs: local access flag")
),
@@ -908,19 +908,19 @@
= list.condense([Access, PerInstance, Constness]) :-
AccessFlag = access(Flags),
(
- AccessFlag = public,
+ AccessFlag = acc_public,
Access = [public]
;
- AccessFlag = protected,
+ AccessFlag = acc_protected,
Access = [family]
;
- AccessFlag = private,
+ AccessFlag = acc_private,
Access = [private]
;
- AccessFlag = default,
+ AccessFlag = acc_default,
Access = [assembly]
;
- AccessFlag = local,
+ AccessFlag = acc_local,
% Access = [private]
unexpected(this_file,
"decl_flags_to_fieldattrs: local access flag")
@@ -1461,7 +1461,7 @@
DefnEntity = mlds_function(no, Params, body_defined_here(Statement),
Attributes, EnvVarNames),
- Flags = init_decl_flags(public, one_copy, non_virtual, overridable,
+ Flags = init_decl_flags(acc_public, one_copy, non_virtual, overridable,
const, concrete),
Defn = mlds_defn(entity_export(ExportName), Context, Flags, DefnEntity).
Index: mlds_to_java.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mlds_to_java.m,v
retrieving revision 1.104
diff -u -b -r1.104 mlds_to_java.m
--- mlds_to_java.m 8 Sep 2008 03:39:05 -0000 1.104
+++ mlds_to_java.m 2 Jan 2009 15:45:56 -0000
@@ -2080,11 +2080,15 @@
:- pred output_access(access::in, io::di, io::uo) is det.
-output_access(public, !IO) :- io.write_string("public ", !IO).
-output_access(private, !IO) :- io.write_string("private ", !IO).
-output_access(protected, !IO) :-io.write_string("protected ", !IO).
-output_access(default, !IO) :- maybe_output_comment("default", !IO).
-output_access(local, !IO).
+output_access(acc_public, !IO) :-
+ io.write_string("public ", !IO).
+output_access(acc_private, !IO) :-
+ io.write_string("private ", !IO).
+output_access(acc_protected, !IO) :-
+ io.write_string("protected ", !IO).
+output_access(acc_default, !IO) :-
+ maybe_output_comment("default", !IO).
+output_access(acc_local, !IO).
:- pred output_per_instance(per_instance::in, io::di, io::uo) is det.
Index: rtti_to_mlds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rtti_to_mlds.m,v
retrieving revision 1.84
diff -u -b -r1.84 rtti_to_mlds.m
--- rtti_to_mlds.m 11 Feb 2008 21:26:07 -0000 1.84
+++ rtti_to_mlds.m 2 Jan 2009 15:49:53 -0000
@@ -167,10 +167,10 @@
rtti_data_decl_flags(Exported) = MLDS_DeclFlags :-
(
Exported = yes,
- Access = public
+ Access = acc_public
;
Exported = no,
- Access = private
+ Access = acc_private
),
PerInstance = one_copy,
Virtuality = non_virtual,
cvs diff: Diffing notes
--------------------------------------------------------------------------
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