mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 17:33:38 +00:00
Add a version number to the module layout structure.
Estimated hours taken: 0.1 Branches: main Add a version number to the module layout structure. This is needed to allow future changes to layout structures to take place in a backwards compatible manner. However, this change itself is backward compatible only for programs without debugging enabled. If your installed compiler generates the new field but your runtime doesn't define it, or vice versa, you will get strange crashes whenever you use the debugger. runtime/mercury_stack_layout.h: Add a version number field to the start of the module layout structure. compiler/layout_out.m: Fill in the new field. runtime/mercury_grade.h: Increment the binary compatibility version number for debug grades.
This commit is contained in:
@@ -1308,6 +1308,9 @@ output_module_layout_data_defn(ModuleName, StringTableSize, StringTable,
|
||||
io.write_string("\n", !IO),
|
||||
output_layout_name_storage_type_name(ModuleLayoutName, yes, !IO),
|
||||
io.write_string(" = {\n", !IO),
|
||||
VersionNumber = 0,
|
||||
io.write_int(VersionNumber, !IO),
|
||||
io.write_string(",\n", !IO),
|
||||
quote_and_write_string(sym_name_to_string(ModuleName), !IO),
|
||||
io.write_string(",\n", !IO),
|
||||
io.write_int(StringTableSize, !IO),
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
*/
|
||||
|
||||
#define MR_GRADE_PART_0 v14_
|
||||
#define MR_GRADE_EXEC_TRACE_VERSION_NO 6
|
||||
#define MR_GRADE_EXEC_TRACE_VERSION_NO 7
|
||||
#define MR_GRADE_DEEP_PROF_VERSION_NO 2
|
||||
|
||||
#ifdef MR_HIGHLEVEL_CODE
|
||||
|
||||
@@ -1292,6 +1292,7 @@ typedef struct MR_Module_File_Layout_Struct {
|
||||
} MR_Module_File_Layout;
|
||||
|
||||
struct MR_Module_Layout_Struct {
|
||||
MR_uint_least8_t MR_ml_version_number;
|
||||
MR_ConstString MR_ml_name;
|
||||
MR_Integer MR_ml_string_table_size;
|
||||
const char *MR_ml_string_table;
|
||||
|
||||
Reference in New Issue
Block a user