-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
reflection: define Base.generating_output utility function
#51216
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2346,3 +2346,22 @@ function destructure_callex(topmod::Module, @nospecialize(ex)) | |
| end | ||
| return f, args, kwargs | ||
| end | ||
|
|
||
| """ | ||
| Base.generating_output([incremental::Bool])::Bool | ||
|
|
||
| Return `true` if the current process is being used to pre-generate a | ||
| code cache via any of the `--output-*` command line arguments. The | ||
| optional argument `incremental` controls whether to only return `true` | ||
| for that specific mode of compilation. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a latecomer here, but I think even some sophisticated users may not clearly understand what "incremental compilation" means. Maybe add "(i.e.,
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that sounds better. I will make a PR on it.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| !!! compat "Julia 1.11" | ||
| This function requires at least Julia 1.11. | ||
| """ | ||
| function generating_output(incremental::Union{Bool,Nothing}=nothing) | ||
| ccall(:jl_generating_output, Cint, ()) == 0 && return false | ||
| if incremental !== nothing | ||
| JLOptions().incremental == incremental || return false | ||
| end | ||
| return true | ||
| end | ||
Uh oh!
There was an error while loading. Please reload this page.