Don't lower for codegen in functions that are never code generated - #23942
Merged
thewilsonator merged 1 commit intoSep 29, 2026
Merged
Conversation
TurkeyMan
force-pushed
the
pr2_needscodegen_skipcodegen
branch
from
September 29, 2026 13:53
2b02cf1 to
f8cdda6
Compare
Contributor
Author
|
This doesn't feel worthy of a changelog entry... it's really trivial. |
| @@ -0,0 +1,21 @@ | |||
| /* | |||
| DFLAGS: | |||
| REQUIRED_ARGS: -conf= -betterC -c -Icompilable/extra-files/ctfe_only_new | |||
Contributor
There was a problem hiding this comment.
also check that without -c this fails compilation?
Contributor
Author
There was a problem hiding this comment.
Not clear exactly what you mean; is this what you want to see? Ie, proof that it does not attempt to link _d_newclassT when ctfe new is used?
TurkeyMan
force-pushed
the
pr2_needscodegen_skipcodegen
branch
from
September 29, 2026 14:15
f8cdda6 to
ae1cfdf
Compare
DMD perf check
All measurements
c1f8c67 vs merge-base 10adc6c · about these metrics |
TurkeyMan
force-pushed
the
pr2_needscodegen_skipcodegen
branch
from
September 29, 2026 14:33
ae1cfdf to
3279777
Compare
Scope.needsCodegen() is now false inside a function with skipCodegen set, e.g. a @__ctfe function, so e.g. its `new` is not lowered to the _d_newclassT hook, which a minimal runtime may not have.
TurkeyMan
force-pushed
the
pr2_needscodegen_skipcodegen
branch
from
September 29, 2026 14:36
3279777 to
c1f8c67
Compare
thewilsonator
approved these changes
Sep 29, 2026
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.
Scope.needsCodegen() is now false inside a function with skipCodegen, ie; a @__ctfe function, so its
newis not lowered to the _d_newclassT hook, which a minimal runtime may not have.