Skip to content

Strategy for 5.2.0 Unit_info and compunit

Mark Shinwell edited this page Jul 12, 2024 · 6 revisions

This page describes our strategy for merging 5.2.0 with respect to:

  • the new Unit_info module
  • the new compunit type (e.g. Cmo_format.compunit)
  • the new Symtable.Compunit module.

Unit_info

Places that have Compilation_unit.t already on our side should stay like that, even if upstream has changed from string (or some other type) to Unit_info.t.

Possible change: maybe we should change modname inside Unit_info to be of type Compilation_unit.t, but let's try to avoid this at first. This would enable us to improve places in the code which are going to end up having Unit_info.t and Compilation_unit.t values adjacent to each other. (Typemod.type_implementation is probably an example of that.)

compunit

We're going to try to change things which use Cmo_format.compunit to use Compilation_unit instead. This will clean up some existing code (e.g. deleting Compilation_unit.to_global_ident_for_bytecode).

Symtable.Compunit

We're trying to remove this module, replacing it with Compilation_unit.t.