transpile: Allow macro conversion to succeed only for some expansions#1806
Open
Rua wants to merge 7 commits into
Open
transpile: Allow macro conversion to succeed only for some expansions#1806Rua wants to merge 7 commits into
Rua wants to merge 7 commits into
Conversation
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.
If there is ever a failure to convert one of the expansion sites of a macro, or it fails to fold into a single common type, then the entire macro is discarded and left in its expanded form. This PR adds a fallback mechanism: if the conversion succeeds for some of the expansion sites, then those will be converted to use the macro, and only the ones that failed will be left expanded.
The
expr_resultsvalue stores all the errors of the conversion attempts for each expansion site. Currently, theOkvariant is just empty, but this is planned to hold information about functional macro arguments in the future.