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

refactor(codegen): accept SymbolTable instead of Mangler #8829

Merged
merged 1 commit into from
Feb 2, 2025

Conversation

danbulant
Copy link
Contributor

It seems to be that the easiest way to rename variables is to use rename_symbol from SymbolTable and to let it be applied during codegen - this is what Mangler does.

This PR changes Codegen to accept (any) SymbolTable instead of just Mangler itself, and for Mangler build output to be a new SymbolTable, after consuming itself (which makes it clear at the type level if a Mangler has been built or not).

This also moves the few symbol table helper methods from Mangler to SymbolTable itself, and adds an example of Mangler use to it's documentation.

Codegen dependencies now include semantic (which was transient by mangler before). It's dependency on Mangler could be removed, though I've left it to allow easy linking of docs (with_symbol_table points users to Mangler, hopefully helps with migration?)

Copy link

graphite-app bot commented Feb 1, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@github-actions github-actions bot added A-semantic Area - Semantic A-minifier Area - Minifier A-codegen Area - Code Generation C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Feb 1, 2025
Copy link

codspeed-hq bot commented Feb 2, 2025

CodSpeed Performance Report

Merging #8829 will not alter performance

Comparing danbulant:main (26840a8) with main (831928d)

Summary

✅ 33 untouched benchmarks

@Boshen Boshen merged commit 6aa2dde into oxc-project:main Feb 2, 2025
25 checks passed
@oxc-bot oxc-bot mentioned this pull request Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area - Code Generation A-minifier Area - Minifier A-semantic Area - Semantic C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants