Add :single module compile time flag#15425
Closed
ysbaddaden wants to merge 4 commits intocrystal-lang:masterfrom
Closed
Add :single module compile time flag#15425ysbaddaden wants to merge 4 commits intocrystal-lang:masterfrom
:single module compile time flag#15425ysbaddaden wants to merge 4 commits intocrystal-lang:masterfrom
Conversation
also uses a specific name to not override the `#single_module?` accessor (used to clone a host compiler for macro runs).
ysbaddaden
commented
Feb 6, 2025
This isn't neded, and it's always overriden by the call to `compiler.release!` a few lines below anyway.
The object now has methods to set cross compiler and add emit targets; they're responsible from enabling the single module property. We thus no longer need the two query methods.
straight-shoota
approved these changes
Feb 7, 2025
Member
Collaborator
Author
|
Yeah. Closing for now. |
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.
Just like the
:releaseflag it can be useful to know during macros if we're compiling to a single module.For example alongside the
Linkageannotation, we would be able to mark the__crystal_*functions as internal only when compiling to a single module. For example:{% if flag?(:single_module) %} @[Linkage("internal")] {% end %} fun __crystal_once_init : Nil endRelated to #15426