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
Named phi #426
Conversation
Pull Request Test Coverage Report for Build 1895
💛 - Coveralls |
name = f_str.format(c) | ||
while name in used_names: | ||
c += 1 | ||
name = f_str.format(c) |
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.
Should we add a timeout (e.g. if c >= 1000: raise Exception
). Unlikely to come up and would incur a performance cost, but you never know?
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.
As python ints don't overflow don't see the need to give up.
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.
I just realized we can assume that the space of names is finite, so we will eventually find a name.
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.
(because the length of the program must be finite)
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.
LGTM
Adds utility function
gen_free_name
changes
ssa
:ssa
now takes an optional argumentphi
which can be either a function or a string"phi"
phi
is a string thenssa
will assume that such a name exists in the environment of the decorated functionphi
is a function thenssa
will generate a new name and associatephi
with the name in the generated codeconvert_tree_to_ssa
tossa