mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 09:53:36 +00:00
779b47f4f207a1e98ddca1bb0158d7a7901bf058
Estimated hours taken: 2 Various bug fixes and cleanups for the code in the runtime directory. runtime/mercury_bootstrap.h: runtime/mercury_regs.h: runtime/mercury_stacks.h: runtime/mercury_type_info.h: Move #defines that are there just for backwards compatibility into mercury_bootstrap.h. runtime/process_getopt: Add MR_ prefixes to the names `_GETOPT_H', `no_arguments', and `required_argument' which are defined by mercury_getopt.h, to make mercury_getopt.h macro-namespace-clean. runtime/mercury_getopt.h: Apply the new version of the process_getopt script. runtime/mercury_imp.h: Make mercury_bootstrap the first header file that is #included, in case some of the macros defined in it are used in declarations in other header files. runtime/mercury_memory.h: Delete duplicate definitions of MAX_REAL_REG, NUM_SPECIAL_REG, and MAX_VIRTUAL_REG -- these are all already defined in mercury_memory_zones.h. runtime/mercury_memory_zones.h: Delete definition of NUM_SPECIAL_REG, since mercury_regorder.h already defines MR_NUM_SPECIAL_REG, which should be used instead of NUM_SPECIAL_REG. The value of NUM_SPECIAL_REG was long obsolete. runtime/mercury_regorder.h: Fix some bugs in the definition of MR_min_sol_hp_rec -- it was using `mr40', which is undefined, instead of `mr(40)'. Also add some comments. runtime/mercury_regs.h: Fix a bug: use MR_NUM_SPECIAL_REGS instead of NUM_SPECIAL_REGS. Note that this bug fix unfortunately breaks backwards compatibility, at least for procedures with more than 32 arguments, since it affects the mapping from r(N) to the fake_reg array. However, there was no alternative, since the old mapping was broken: for example, the old mapping used the same fake_reg slot for both r(41) and MR_global_hp. runtime/mercury_bootstrap.h: Change MR_GRADE_PART_0 from `redofr' to `v1', and document that that part of the grade is a binary compatibility version number. The reason for changing the grade is to ensure that the change in binary backwards compatibility resulting from the changes to runtime/mercury_regs.h will cause link errors rather than just random behaviour for procedures with >32 arguments. runtime/mercury_agc_debug.c: Use MR_NUM_SPECIAL_REGS instead of NUM_SPECIAL_REGS. Also add some XXX comments, since all of the places where NUM_SPECIAL_REGS was used are broken anyway -- they should be using MAX_FAKE_REG instead of MAX_REAL_REG + NUM_SPECIAL_REG. But I think the current definition is put there for efficiency, even though it's known to be broken for procedures with >32 arguments, so I didn't change the code to use MAX_FAKE_REG.
…
…
Reportedly Mercury does not work on Solaris 2.5.1 if it is compiled with
gcc 2.7.x. It should however work fine on Solaris 2.5.1 if you compile
it with gcc 2.8, or if you use gcc 2.7.x with an earlier version of Solaris.
The binary distribution for Solaris that we distribute was compiled
with gcc 2.7.2, so if you have Solaris 2.5.1, you may need to compile
Mercury yourself from our source distribution.
("Solaris 2.x" is also known as "SunOS 5.x".)
Languages
Mercury
85.4%
C
8.7%
Shell
1.4%
Makefile
1%
JavaScript
1%
Other
2%