[m-rev.] For review: Improve the name mangling of foreign methods in the IL backend

Jonathan Morgan jonmmorgan at gmail.com
Thu Jun 7 16:28:39 AEST 2007


On 6/6/07, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
>
> On Tue, 5 Jun 2007, Jonathan Morgan wrote:
>
> > Estimated hours taken: 4
> > Branches: main
> >
> > Improve the name mangling for foreign language methods under the IL backend.
> > Currently, method names containing spaces, punctuation, and other unusual
> > characters are acceptable in IL (because all method names are quoted), but
> > are
> > not acceptable in C# or Managed C++.  This change converts all such foreign
> > names that are not alphanumeric or underscore to a valid C identifier in the
> > same way as in the C-based backends.
> >
> > compiler/mlds_to_il.m:
> >       Alter the name mangling routines to allow it to mangle foreign names
> >       differently from ordinary IL names.  Alter the forwarding methods for
> >       foreign routines to call the mangled version of the method in the
> >       foreign module, rather than calling one with the IL method name.
> >
> > compiler/mlds_to_managed.m:
> >       Alter the generation of foreign methods to use the new mangled name.
>
> This change causes tests/valid/foreign_type_spec to fail.

The error message given is:

mercury_compile: cannot find `foreign_type_spec.foreign_type.int' in
directories ., C:/cygwin/usr/local/mercury-rotd-2007-05-26/lib/mercury/ints.
foreign_type_spec.m:007: In definition of type `foreign_type_spec.ft2'/0:
foreign_type_spec.m:007:   error: undefined type `foreign'/0.
mercury_compile: cannot find `foreign_type_spec.int0' in directories
., C:/cygwin/usr/local/mercury-rotd-2007-05-26/lib/mercury/ints.

While I'm no expert in the Mercury build system, I wouldn't expect my
change to cause this problem.

Jon
--------------------------------------------------------------------------
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