-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
More function inlining #470
Comments
Inlining is not that simple. There are many potential issues to tackle.
|
A difficulty is to handle variables correctly, even with shadowing (renaming might be required). If the function return value is used, it can be difficult to inline it (and do side-effects in the correct order). int f() {
for (...) { ... }
return ...;
}
void main() {
int a = g() + f();
} To inline |
I reopened #469 , as it is the only one with a chance of being easy to implement. |
I was thinking that it is an unnecessary restriction in the case that the function is called in a simple assignment statement: |
It should (in some circumstances) be possible to inline a function that follows these rules:
void
type, or ends in an unconditional return statement.return
statements.The text was updated successfully, but these errors were encountered: