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

remove the .goto pragma/feature #1363

Merged
merged 1 commit into from
Jun 30, 2024

Conversation

zerbina
Copy link
Collaborator

@zerbina zerbina commented Jun 29, 2024

Summary

The .goto pragma is neither documented nor tested, and most of the
compiler is unaware of it. Everything related to the feature is removed
from the compiler.

Details

  • the .goto pragma could be used on variables of enum type,
    turning all assignments to the variable into jumps to branches of an
    associated case statement
  • remove the sfGoto symbol flag
  • remove the reports associated with the .goto pragma
  • keep the wGoto enum; it's part of the C keyword set

Summary
=======

The `.goto` pragma is neither documented nor tested, and most of the
compiler is unaware of it. Everything related to the feature is removed
from the compiler.

Details
=======

* the `.goto` pragma could be used on variables of enum type,
  turning all assignments to the variable into jumps to branches of an
  associated `case` statement
* remove the `sfGoto` symbol flag
* remove the reports associated with the `.goto` pragma
* keep the `wGoto` enum; keeping it has more or less no cost, and it
  could become useful in the future again
@zerbina zerbina added compiler/sem Related to semantic-analysis system of the compiler compiler/backend Related to backend system of the compiler simplification Removal of the old, unused, unnecessary or un/under-specified language features. labels Jun 29, 2024
@zerbina zerbina added this to the C backend rework milestone Jun 29, 2024
Copy link
Collaborator

@saem saem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd perhaps add a comment to wGoto saying it:

## was previously used but isn't currently, keeping it because it'll likely be used in the future

Or something like that.

@zerbina
Copy link
Collaborator Author

zerbina commented Jun 29, 2024

Apologies, I forgot about the double-duty of some TSpecialWord. wGoto is part of the C keywords, and therefore must stay around for the C name mangling to continue mangling locals named goto.

I've updated the PR message accordingly.

@saem
Copy link
Collaborator

saem commented Jun 29, 2024

/merge

Copy link

Merge requested by: @saem

Contents after the first section break of the PR description has been removed and preserved below:


Notes for Reviewers

@chore-runner chore-runner bot added this pull request to the merge queue Jun 29, 2024
Merged via the queue into nim-works:devel with commit eb5fa68 Jun 30, 2024
31 checks passed
@zerbina zerbina deleted the remove-goto-feature branch July 7, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/backend Related to backend system of the compiler compiler/sem Related to semantic-analysis system of the compiler simplification Removal of the old, unused, unnecessary or un/under-specified language features.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants