-
Notifications
You must be signed in to change notification settings - Fork 314
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
[Support] Allow erasing names in Namespace #7424
Conversation
Allowing erasing names in a namespace seems more sane than micro-managing which names gets added to a namespace. E.g., it's convenient to use `Namespace::add(SymbolCache &` to efficiently prime a namespace, and then surgically removing some known identifier,, instead of having to re-implement how symbols are added to the namespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me!
The namespace data-structure is not a simple set of reserved names, it's a map of prefixes to index, and erasing a single string can easily leave it in a bit of an inconsistent state (such that the removed name won't appear available consistently depending on whether it was directly requested or not). As one example, given This is an optimization so that It seems undesirable to leave the data-structure in that state. I haven't looked at the linked PR yet to grok the motivation so I'm not sure what alternatives to suggest. WDYT? |
@dtzSiFive this is obviously a gun that we're providing users to shoot themselves with, if they're using the Currently, there isn't really a way to do that, since the only two I don't really care how this is done, as long as it's possible. If it's more paletable to add an optional We can also just add a |
a73c2cd
to
fabf2ed
Compare
Since this is blocking internal work, i'm going to go ahead and merge. @dtzSiFive feel free to raise a post-merge issue if you think the solution is too controversial - I added a |
Allowing erasing names in a namespace seems more sane than micro-managing which names gets added to a namespace. E.g., it's convenient to use
Namespace::add(SymbolCache &
to efficiently prime a namespace, and then surgically removing some known identifier,, instead of having to re-implement how symbols are added to the namespace.Required for #7425.