Estimated hours taken: 0.5
Branches: main
Fix the dynamic linking examples in extras.
extras/dynamic_linking/dl_test.m:
extras/dynamic_linking/dl_test2.m:
extras/dynamic_linking/hello.m:
Conform to name changes in the dl module.
Clean up the code so that it conforms to our current coding standard.
Estimated hours taken: 0.1
extras/dynamic_linking/hello.m:
Add the function `add3int', which is used by the dl_test.m
test case. I forgot to commit this with my previous change.
Estimated hours taken: 2
Fix some problems with dynamic linking for the MLDS back-end.
extras/dynamic_linking/name_mangle.m:
browser/name_mangle.m:
Fix a bug with the name mangling of the arity for functions;
the mangling algorithm here didn't match what the compiler
actually outputs.
Clarify the documentation about the meaning of the `arity'
field.
extras/dynamic_linking/dl.m:
Fix a bug with the arity checks for functions;
they were always failing.
For the MLDS back-end, check that the argument type
isn't `char' or `float'; those are not supported.
Document that restriction.
extras/dynamic_linking/dl_test.m:
extras/dynamic_linking/dl_test.exp:
extras/dynamic_linking/hello.m:
Add a test of dynamically linking functions and
passing and returning floating-point arguments.
NEWS:
Document the restriction that dl__mercury_sym doesn't support
argument types `float' or `char' for the MLDS back-end.
Estimated hours taken: 5
extras/dynamic_linking/dl.m:
New module, containing support for dynamic linking
(i.e. a binding to dlopen(), dlsym(), and dlclose()).
extras/dynamic_linking/name_mangle.m:
New module, containing a representation for Mercury procedure
specifiers and a function for mangling them into symbol names.
extras/dynamic_linking/dl_test.m:
extras/dynamic_linking/dl_test.exp:
extras/dynamic_linking/hello.m:
A test case (and sample program) for the use of dynamic linking.
extras/dynamic_linking/README:
A brief README file describing the files in this directory.
extras/dynamic_linking/Mmakefile:
A simple Mmakefile to build it all and test it.
NEWS:
Mention the new dynamic linking support.
compiler/llds_out.m:
Add some comments warning about code duplication
between the code here and that in extras/dynamic_linking/name_mangle.m
(and also profiler/demangle.m and util/mdemangle.c).