Skip to content

Simplify and strenghten the representation of file infos - #96

Merged
fantazio merged 5 commits into
LexiFi:masterfrom
fantazio:file_infos
Aug 21, 2026
Merged

Simplify and strenghten the representation of file infos#96
fantazio merged 5 commits into
LexiFi:masterfrom
fantazio:file_infos

Conversation

@fantazio

Copy link
Copy Markdown
Collaborator

Rather than have 4 different optional fields (signature, cmt_struct, cmti_uid_to_decl, and location_dependencies) depending on the file type (.cmt or .cmti), we now have a single field cm_infos which binds a representation to the specific file types: .cmti files contain a signature and a cmti_uid_to_decl, .cmt files contain a structure, a location_dependencies, and optionally a signature (when read after the corresponding .cmti).

Along with this new representation, surrounding code is simplified as well.

In addition, cmi_infos-related code is now entirely discarded.

They are now merged into the new `annots` fields, which expliclty states
whether the content of the compilation unit is a structure, a signature
or both. The initial case is Neither (no compilation unit), as is the
case when the content of a .cmt or .cmti file is not handled (e.g. a
Partial_implementation)
Remove a lot of anticipated initialization (reading the .cmt for .cmti
and vice-versa). This results in simpler init functions.
Also errors when changing from .cmt to .cmti file of the same
compilation unit (the order must be .cmti then .cmt).
Both the cache and the `read` function used to store/return a tuple
containg the cmi_infos and the cmt_infos. Cmi_infos are not used anymore
anywhere, thus we can reduce this tuple to only the cmt_infos.
…cies

The former is an intermediate result to produce the latter. They are now
represented via the same field `location_dependencies` of the new type
`loc_dep`.
The shape of location_dependenices depends on the file being processed,
as does annots. Therefore, they are now grouped under the new field and
type `cm_infos` which binds them to their reprensentation depending on
the file type (.cmt or .cmti).

This helps simplifying the code a little. This includes a small refactor
of the interface processing in SeadCode.
@fantazio
fantazio merged commit 9ba9574 into LexiFi:master Aug 21, 2026
5 checks passed
@fantazio
fantazio deleted the file_infos branch August 21, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant