Do not reap module that contain a single type definition #6570
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.
Before this PR deadCodeElimination would generate an internal error if it encountered
a module with precisely 1 definition and that definition was not the module init function.
Meanwhile the compiler will remove the module init function for a module that consists
solely of type declarations. The edge case for deadModule() is then a module with a
single type declaration.
This simple PR merely accepts this edge case and retains the type and the module.
More analysis could be used to determine if it is safe to remove the type and then the
module.
It also retires the future that had been created for this edge case.
Compiled with/without CHPL_DEVELOPER on clang/darwin and gcc/linux64.
Ran start_test over a small portion of release/ for all 4 configurations.
Passed a single-locale paratest on gcc/linux64 with futures.