Skip to content
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

do not lower if using CTFE #14940

Merged
merged 1 commit into from
Mar 3, 2023
Merged

do not lower if using CTFE #14940

merged 1 commit into from
Mar 3, 2023

Conversation

WalterBright
Copy link
Member

This lowering causes a lot of template bloat and slowdown and is not necessary for CTFE execution. CTFE ought to be able to execute new directly.

@WalterBright WalterBright added the Refactoring No semantic changes to code label Mar 2, 2023
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @WalterBright!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#14940"

@WalterBright WalterBright removed the Refactoring No semantic changes to code label Mar 2, 2023
@WalterBright
Copy link
Member Author

Turns out that CTFE ignores the lowering. However, the templates still get instantiated and since the instantiations use the GC this causes problems with -betterC. This PR turns off those instantiations.

@WalterBright
Copy link
Member Author

ping @RazvanN7

@RazvanN7 RazvanN7 merged commit abb7836 into dlang:master Mar 3, 2023
@WalterBright WalterBright deleted the noLowerNew branch March 3, 2023 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants