[m-rev.] for review: refactor mlds_to_il.m
Peter Ross
peter.ross at miscrit.be
Wed Jul 11 20:34:11 AEST 2001
On Wed, Jul 11, 2001 at 06:47:06PM +1000, Fergus Henderson wrote:
> On 10-Jul-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> > EnvVarAddr = lval(var(EnvVar, EnvTypeName)),
> > ml_init_env(EnvTypeName, EnvVarAddr, Context, ModuleName,
> > @@ -572,6 +577,9 @@
> > % type declaration.
> > :- func env_type_decl_flags = mlds__decl_flags.
> > env_type_decl_flags = MLDS_DeclFlags :-
> > + % On the IL backend we use classes instead of structs so
> > + % these fields must be accessible to the mercury_code
> > + % class in the same assembly, hence the public access.
> > Access = public,
>
> Well, it's good that this is documented, but this is still not the right
> approach. Your change to make the access public here has broken separate
> compilation for the C back-end.
>
> One possible solution would be to make the access "default",
> and then have the IL back-end map that to "public" if "assembly"
> access isn't supported for top-level classes.
>
===================================================================
Estimated hours taken: 0.25
Branches: main
compiler/ml_elim_nested.m:
Address some review comments by fjh.
Backout the change to env_type_decl_flags which set the access to
public.
Index: ml_elim_nested.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_elim_nested.m,v
retrieving revision 1.31
diff -u -r1.31 ml_elim_nested.m
--- ml_elim_nested.m 10 Jul 2001 14:49:13 -0000 1.31
+++ ml_elim_nested.m 11 Jul 2001 10:24:52 -0000
@@ -400,8 +400,11 @@
Ctor = mlds__function(no, func_params([], []), yes(Stmt)),
CtorFlags = init_decl_flags(public, per_instance, non_virtual,
overridable, modifiable, concrete),
- CtorDefn = mlds__defn(export("unused"), Context, CtorFlags,
- Ctor),
+
+ % Note that the name of constructor is
+ % determined by the backend convention.
+ CtorDefn = mlds__defn(export("<constructor>"), Context,
+ CtorFlags, Ctor),
Ctors = [CtorDefn]
;
Ctors = []
@@ -428,6 +431,10 @@
%
EnvVar = qual(ModuleName, mlds__var_name("env", no)),
+ % IL uses classes instead of structs, so the code
+ % generated needs to be a little different.
+ % XXX Perhaps if we used value classes this could go
+ % away.
( Target = il ->
EnvVarAddr = lval(var(EnvVar, EnvTypeName)),
ml_init_env(EnvTypeName, EnvVarAddr, Context, ModuleName,
@@ -577,10 +584,7 @@
% type declaration.
:- func env_type_decl_flags = mlds__decl_flags.
env_type_decl_flags = MLDS_DeclFlags :-
- % On the IL backend we use classes instead of structs so
- % these fields must be accessible to the mercury_code
- % class in the same assembly, hence the public access.
- Access = public,
+ Access = private,
PerInstance = one_copy,
Virtuality = non_virtual,
Finality = overridable,
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list