Normalize the variables in the C code to avoid conflict existing between locals, globals and methods.
A pull request to make me familiar with Pharo/Slang again, took some times because of it and some rare cases in the VM code.
Renaming happens between type inferences and inlining.
Rename the variables that are locals, the other ones with a reserved semantic doesn't change.
Reserved names :
super, self ..., names that reference globals or macros, names that reference VM classes
names in the AST that references implicit variables, they do not appear in the C code but most of them are hard coded in Slang
names that reference library variables
We update the occurences of changed variables in type declarations, return type (see genCallPICEnilopmartNumArgs:) and cCode: selectors if needed (see addressIsInFixups:).
We also update for each elements in the AST that needs it the locals and variables list.
Tests have been checked with MuTalk.
Other small changes :
Change in the name of an extern variable (imageName) defined in the C code which is not generated to align with.
Simplify nil gestion by updating the few variables nodes with the name 'nil' in Slang to the equivalent of constants node with the value nil.
Normalize the variables in the C code to avoid conflict existing between locals, globals and methods. A pull request to make me familiar with Pharo/Slang again, took some times because of it and some rare cases in the VM code.
Renaming happens between type inferences and inlining. Rename the variables that are locals, the other ones with a reserved semantic doesn't change.
Reserved names :
We update the occurences of changed variables in type declarations, return type (see genCallPICEnilopmartNumArgs:) and cCode: selectors if needed (see addressIsInFixups:).
We also update for each elements in the AST that needs it the locals and variables list.
Tests have been checked with MuTalk.
Other small changes :
Change in the name of an extern variable (imageName) defined in the C code which is not generated to align with.
Simplify nil gestion by updating the few variables nodes with the name 'nil' in Slang to the equivalent of constants node with the value nil.