-
Notifications
You must be signed in to change notification settings - Fork 164
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
C: Use unique names for variables #2142
Conversation
@certik please let me know if this is the correct approach to move further. There are many tests that still fail and it would require fixes to complete this. |
I think so. This seems what I was thinking. |
To help with the tests, let's hide it behind a compiler option, that way the new name would only be used with the option is given, so current tests should pass. |
Let's first fix all the tests such that all of them are working and then we can add it behind a compiler option so that it does not break with the compiler flag. |
Sure. Depends what the failures are --- the issue with unique names is that all the C tests (in |
I have added the fix, but it's kind of hack-ish as we need to keep in mind about unique_id while emitting the symbol name which can fail easily. How about writing a pass if we have |
I think writing the ASR pass will be better, as it will fix this issue for all the backends. Here is what the pass could do:
I think this might be as easy as just modifying the symbol table, since we don't reference things by name, except in ExternalSymbols, so those would have to be updated too. |
I'll keep this PR open as all the tests pass successfully. I'll work on writing a pass in a new PR tomorrow morning. |
Completed in #2149 |
#2129