Skip to content

[Serialization] Minor ModuleFile/ModuleFileSharedCore improvements #33789

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 4, 2020

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Sep 3, 2020

  • Add properties to ModuleFile that hold some informations from the control block.
  • ExtendedValidationInfo parameter for ModuleFileSharedCore::load() cannot be nullptr. Make it non-defaulted Rvalue reference.
  • Remove ExtendedValidationInfo parameter from ModuleFileSharedCore::load(). Now that all required information can be fetched from ModuleFile.

* Add properties to ModuleFile which holds information from the control
  block.
* 'ExtendedValidationInfo' parameter for 'ModuleFileSharedCore::load()'
  cannot be 'nullptr'. Make it non-defaulted Rvalue reference.
@rintaro
Copy link
Member Author

rintaro commented Sep 3, 2020

@swift-ci Please smoke test

@rintaro rintaro requested a review from akyrtzi September 3, 2020 19:54
@akyrtzi
Copy link
Contributor

akyrtzi commented Sep 3, 2020

It's a bit unclear to me why we need the bits accessible from both ModuleFile and ExtendedValidationInfo.
You are replacing the accesses from ExtendedValidationInfo with accesses from ModuleFile but then why do we need them in ExtendedValidationInfo and if we do need them, why add the accessors in ModuleFile and not initialize the ExtendedValidationInfo bits from the Core object?

@rintaro
Copy link
Member Author

rintaro commented Sep 3, 2020

These bits are not actually needed in ExtendedValidationInfo because other users don't use them. But when reading OPTIONS_BLOCK inside CONTROL_BLOCK, ExtendedValidationInfo is the only thing to store the informations. So we need to initialize ExtendedValidationInfo first, then read the bits from it to initialize ModuleFileSharedCore.

Populated 'ExtendedValidationInfo' is not used at all.
@rintaro
Copy link
Member Author

rintaro commented Sep 3, 2020

Added another commit to remove ExtendedValidationInfo parameter from ModuleFileSharedCore::load(). Any of callers don't use it.

@rintaro
Copy link
Member Author

rintaro commented Sep 3, 2020

@swift-ci Please smoke test

@akyrtzi
Copy link
Contributor

akyrtzi commented Sep 3, 2020

Nice improvement to avoid passing ExtendedValidationInfo to so many APIs!
Is ExtendedValidationInfo still usable from other places or can it be moved to implementation detail of ModuleFileSharedCore?

@rintaro
Copy link
Member Author

rintaro commented Sep 3, 2020

getSDKPath() and getExtraClangImporterOptions() still has some users which directly call validateControlBlock().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants