On 11/25/2013 10:50 AM, Iyer, Balaji V wrote:
I have fixed this issue. My function to map the variable's context from the spawner to the spawn helper function was going into the lambda function. I made it stop by adding a language specific copy_tree_body (basically stop going into the lambda function's body for C++ and for the rest of the times just use copy_tree_body_r, no code duplicating is done between the two) that and it works fine now.
I doubt it was walking from the enclosing function into the body of the lambda function. Looking at the patch, it seems that what you're avoiding is walking into the closure object itself, and adding an entire new langhook seems like overkill for that.
I think a better approach would be to add a cp_build_cilk_spawn that uses stabilize_call to pre-evaluate the arguments of the call.
Jason