Simplify and strenghten the representation of file infos - #96
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rather than have 4 different optional fields (
signature,cmt_struct,cmti_uid_to_decl, andlocation_dependencies) depending on the file type (.cmt or .cmti), we now have a single fieldcm_infoswhich binds a representation to the specific file types: .cmti files contain a signature and acmti_uid_to_decl, .cmt files contain a structure, alocation_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.