comparison src/parallel_execution/generate_stub.pl @ 547:8814524d29ae

get code gear before continuation
author mir3636
date Tue, 26 Jun 2018 20:16:03 +0900
parents d8e87b3b2be0
children 4fdeb0afc187
comparison
equal deleted inserted replaced
546:d8e87b3b2be0 547:8814524d29ae
487 } else { 487 } else {
488 print $fd "\tGearef(context, $ntype)->$pName = $arg;\n"; 488 print $fd "\tGearef(context, $ntype)->$pName = $arg;\n";
489 } 489 }
490 $i++; 490 $i++;
491 } 491 }
492 print $fd "${prev}context->before = C_$codeGearName;\n";
492 print $fd "${prev}goto meta(context, $next->$method);\n"; 493 print $fd "${prev}goto meta(context, $next->$method);\n";
493 next; 494 next;
494 } elsif(/^(.*)par goto (\w+)\((.*)\);/) { 495 } elsif(/^(.*)par goto (\w+)\((.*)\);/) {
495 # handling par goto statement 496 # handling par goto statement
496 # convert it to the parallel 497 # convert it to the parallel
573 if ($hasParGoto) { 574 if ($hasParGoto) {
574 print $fd "${prev}Gearef(context, TaskManager)->taskList = context->taskList;\n"; 575 print $fd "${prev}Gearef(context, TaskManager)->taskList = context->taskList;\n";
575 print $fd "${prev}Gearef(context, TaskManager)->next1 = C_$next;\n"; 576 print $fd "${prev}Gearef(context, TaskManager)->next1 = C_$next;\n";
576 print $fd "${prev}goto meta(context, C_$next);\n"; 577 print $fd "${prev}goto meta(context, C_$next);\n";
577 } else { 578 } else {
579 print $fd "${prev}context->before = C_$codeGearName;\n";
578 print $fd "${prev}goto meta(context, $next);\n"; 580 print $fd "${prev}goto meta(context, $next);\n";
579 } 581 }
580 next; 582 next;
581 } 583 }
582 if ($hasParGoto) { 584 if ($hasParGoto) {
586 next; 588 next;
587 } elsif ($next eq "meta") { 589 } elsif ($next eq "meta") {
588 print $fd $_; 590 print $fd $_;
589 next; 591 next;
590 } else { 592 } else {
593 print $fd "${prev}context->before = C_$codeGearName;\n";
591 print $fd "${prev}goto meta(context, C_$next);\n"; 594 print $fd "${prev}goto meta(context, C_$next);\n";
592 next; 595 next;
593 } 596 }
594 } elsif(/^.*(struct|union)?\s(\w+)\*\s(\w+)\s?[=;]/) { 597 } elsif(/^.*(struct|union)?\s(\w+)\*\s(\w+)\s?[=;]/) {
595 my $type = $2; 598 my $type = $2;