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

Global renaming lists #378

Open
therontarigo opened this issue May 7, 2024 · 0 comments
Open

Global renaming lists #378

therontarigo opened this issue May 7, 2024 · 0 comments

Comments

@therontarigo
Copy link
Contributor

therontarigo commented May 7, 2024

Managing a list of identifiers that will be globally renamed in all instances can solve these limitations:

  • unclean macros (macros containing references to identifiers other than their own arguments) break
  • macro names are not shortened
  • user-defined type names are not shortened (# 290 "Minifying structs ...")

Global renaming will be subject to some restrictions:

  • Any variable or function whose name is a globally renamed identifier must be excluded from inlining, reordering, and dead code removal.
  • Global renaming short names may not be reused for normal scoped renaming.

Managing a list of struct member names and their renamings can solve #290 "...and their members". Consistent struct member renaming avoids the issue of needing to know an expression's type.

Please leave a message before implementing a significant change, so that we can agree on the solution.

The implementations for each of these mechanisms are similar. In each case: it falls somewhat short of optimal renaming analysis, but the implementation is far simpler than for a fully general solution. Is this reasonable?

Exposing --global-renaming-list option to the user may be usable for workarounds in some situations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant