136
edits
No edit summary |
No edit summary |
||
Line 9: | Line 9: | ||
===Example=== | ===Example=== | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
|<syntaxhighlight lang="c"> | |<syntaxhighlight lang="c"> | ||
Line 22: | Line 14: | ||
// In the given example, variables a, b and c are known. | // In the given example, variables a, b and c are known. | ||
// They are propagated to the rest of the body of main. | // They are propagated to the rest of the body of main. | ||
#pragma EMX_TRANSFORMATION ConstPropagation | #pragma EMX_TRANSFORMATION ConstPropagation | ||
int main(void) { | int main(void) { | ||
Line 35: | Line 28: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|<syntaxhighlight lang="c"> | |<syntaxhighlight lang="c"> | ||
// | |||
// The following code is the generated code after the transformation has been applied. | // The following code is the generated code after the transformation has been applied. | ||
// | |||
int main(void) { | int main(void) { | ||
int a = 2; | int a = 2; | ||
int b = a; | int b = a; | ||
int c; | |||
int d; | |||
c = 4; | |||
c = | d = 6; | ||
d = | |||
return 0; | return 0; | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} |
edits