Hello All 

I am trying to implement an optimization in the X10 compiler. To implement it I 
am trying to modify the AST and replace my own nodes with the existing nodes. 
For example in the following code -- 

finish { 
for(var i:Int=0; i<n; i++) { 
async S1; 
} 
} 

-- if I want to replace the "finish" construct with my own code, say 

finish { 
for(var i:Int=0; i<m; i++) { 
S2; 
} 
} 

then I am able to successfully implement that. But suppose "S1" also consist a 
"finish" construct then, the inner "finish" gets replaced with the new code 
while the outer "finish" and all its body is somehow overwritten by the inner 
one. I am trying to follow the style similar to "ForLoopOptimization". I also 
modify the AST in the "leaveCall()" method i.e. whenever I see a "finish" 
construct I "return" my modified node instead of the original "finish" node. 

What can I be missing, cause this problem occurs only when there is a finish 
inside another "finish" body. 

Thank you 

Regards 

Suyash Gupta 

------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to